Bill Marcum wrote:
On Sun, Aug 21, 2005 at 06:18:47AM -0500, Hugo Vanwoerkom wrote:Hi, A programming question: I want to have a program that runs in a user's /home dir. write to /var/run. That can be done by running the program with sudo. Is there any other way? E.g. programming with PAM? Example? Thanks.Why do you want the program to write to /var/run? Does it require root privileges other than for that purpose? If not, couldn't you write to /tmp or the user's home directory?
Thanks for replying. I have a souped up version of vcstime that runs with colors and sound as a daemon. A client program can talk to it over a port and adjust the parameters.
But the daemon should only use sound (marine chimes) if there is no fvwm (my windowmanager) running for any users (I have a multiseat linux, there can be several users logged on) with similar sounds. So all .fvw2rc's have an startfunction and exitfunction that make an entry into /var/run with sudo to indicate that sound is being produced. The daemon looks at that and decides wether to produce sound or not.
Can anybody write to /tmp? I could only figure out writing to /var/run with sudo. It gets too complicated with multi-user to check everybody's home directory.
H