↧
Answer by Henrik for Switch user in a init script?
For upstart, use:setuid myuserexec command args
View ArticleAnswer by Johan Nestaas for Switch user in a init script?
su is probably a more universal approach, but this is also possible on some common distributions with sudo:sudo -u $MUSER $COMMAND $ARGS(just reread your question and didn't realize that doesn't work...
View ArticleAnswer by guettli for Switch user in a init script?
I use this:su -l $MUSER -c "myCommand args..."Update: Since there is interest in this answer, I explain the way I use it here.We run servers as normal linux users, not root. The username contains three...
View ArticleSwitch user in a init script?
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...
View Article