ubuntu - Execute script from rc.local as user instead of ...
Running sudo su user01 in a script does not mean the following commands are sent to the resultant shell. In fact, it likely means a new shell is spawned as user01, which never exits! Two things: You can execute a command as another user either by passing the -c 'command...' argument to su, like su user01 -c '/etc/init.d/script start'.; Starting a service that uses /etc/init.d from rc.local isn ...