What is setsid?
2 setsid Examples
1. Execute a program even after log out
Just like nohup and screen command, you can use setuid to execute a program even after you log-out as shown below. The following example will run the ./your-long-running-script.sh even after you log-out.
# setsid ./your-long-running-script.sh
2. Execute a program with an argument in setsid
You can also execute a program that requires an argument as shown below. The following example executes ./custom-script.sh with ‘sample-argument’ as its argument.
# setsid ./custom-script.sh 'sample-argument'
Syntax and Options
setsid program [arg...]