Here's my Init script which I have at my Ubuntu workstation. I need to run a command as another user than root, but I just can't get my head around how it should be done. Neither sudo -u
or su newuser
seems to work.
The script:
respawnconsole nonestart on runlevel [2345]stop on runlevel [06]script su "anotherUser" -c ./myCommandend script