bash - Switch between users in an upstart script -


is possible have upstart script runs pre-script root rest normal_user. i'm trying like:

setuid normal_user  pre-start exec su -c "echo i'm root" root  script exec /bin/bash <<"eot"     echo "haha, i'm normal user" eot 

is necessary drop setuid?

i got working removing setuid normal_user , change

exec /bin/bash <<"eot" 

to

exec sudo -u normal_user /bin/bash <<"eot" 

Comments