So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in?
sudo nohup nice foo.bash &
or
noh
I guess all of them do an exec* syscall to pass the ball to the next one, so, whatever the order, it won't leave any hanging processes.
I'd say that nohup should be last so that the two other don't clober the signal handler. (I'm sure nice does not play with signals, but sudo does.)
Then, sudo and nice, it all depends on which way you want to alter the scheduling priority with nice.