Example how to run a command as another user, when the other user has no login shell.
This command must be run as root.
su -m cacti -c "/usr/local/share/cacti/scripts/bind9-stats.pl index"
It is very useful to use the -m flag (leaves the environment unmodified) when the substituted user has no login shell.
For example, editing a users crontab requires the $EDITOR variable to be set.
Tring to edit a users crontab will fail if the environment isn't properly set:
su www -c "crontab -e"
This account is currently not available.
With the -m flag set, root's environment is used, so the following command will work: