You are not logged in.

#1 2007-02-24 17:22:44

Master One
Member
From: Europe
Registered: 2007-01-21
Posts: 249

How to let script run as user by daemon running as root?

As known, NetworkManagerDispatcher is a daemon run by root, executing scripts in /etc/NetworkManager/dispatcher.d/ on interface-status-change.

I want to place a file in that directory which should execute a command as a certain user, precisely it is the command "fusesmb -o allow_other /media/SMB.net", which needs the config file ~/.smb/fusesmb.conf in that users home-dir.

Any idea, how to handle this?

Offline

#2 2007-02-24 17:52:23

smoon
Member
Registered: 2005-08-22
Posts: 468
Website

Re: How to let script run as user by daemon running as root?

You could try something like

su username - -c "fusesmb -o allow_other /media/SMB.net"

Offline

#3 2007-02-25 18:55:44

Master One
Member
From: Europe
Registered: 2007-01-21
Posts: 249

Re: How to let script run as user by daemon running as root?

Thanks, smoon, it's now working as supposed to, although the correct command is:

su - username -c "fusesmb -o allow_other /media/SMB.net"

(Don't know, why the order of the "-" is important, but it's only working this way, not the other way around)

Offline

Board footer

Powered by FluxBB