On Sun, May 11, 2014 at 11:12:08AM +1000, Brian May wrote: > What about the task of running a short program for a brief duration, e.g. > from cron scripts? Is using su considered acceptable? > e.g. /etc/cron.daily/spamassassin on wheezy has numerous references to su.
There are two reasons I use su in /etc/cron.daily/spamassassin. One is to change uid/gid, and the other is to reset the shell environment to a base state. The need for this was highlighted in bug 738951. I doubt that this is a problem unique to spamassassin. 'su -l' takes care of both uid switching and environment cleansing. start-stop-daemon only helps with the first. The appropriate solution for resetting the environment isn't apparent. Should s-s-d be extended with such functionality? Or is there a more appropriate tool that I'm missing? noah
signature.asc
Description: Digital signature