My daemon is in "/etc/init.d/"
For verfication purpose
I run your command "su -l myotheruser -c runthiscommand". manually as a root-user shown below.
[root@lin4 storage]# su -l test -c "chroot /home/test/builds/server/schroot /apache/bin/httpd -k start"
I faced this error
chroot: cannot change root directory to /home/test/builds/server/schroot: Operation not permitted
wheather I need to run the command as a non-root user ????
for your reference
ls -l /home/test/builds/server/
drwxrwxrwx 12 test test 4096 2009-10-27 20:34 schroot
Originally Posted by acid_kewpie
you can't *change* the owner, but you can start it running as whoever you want during a boot up. If there is no automatic handling of this via the program itself (many programs will pull levers internally to become unpriviledged users once they no longer needs roots powers) then you can run a command via su, e.g. "su -l myotheruser -c runthiscommand" in your /etc/rc.local script for example.