I try to run the nohup command and run it as a different user, but every time I do this, two processes are generated.
For instance:
$ nohup su -s /bin/bash nobody -c "my_command" > outfile.txt &
This definitely starts my_command like no one else, but there is an additional process that I don't want to show:
$ ps -Af . . . root ... su -s /bin/bash nobody my_command nobody ... my_command
And if I kill the root process, no one will continue the process ... but is there a way to not start the root process at all? Since getting the identifier my_command and killing is a bit more complicated.
source share