setsid: Keep Linux / UNIX program running while you logs out

by on October 16, 2007 · 0 comments· LAST UPDATED October 17, 2007

in , ,

I already wrote about nohup command, which allows you to ignore HUP (hangup) signal and keep running the command after user logged out. You can accomplish the same behavior using screen or disown command.

setsid is another program that runs a program in a new session. For example run a script called ~/scripts/mirror.site:
ssh you@remote-box.com
setsid ~/scripts/mirror.site
logout

You can also pass argument to command or script:
setsid /usr/bin/beep-media-player '/nas/mp3/xyz.mp3'

Please note that setsid included in miscellaneous system utilities package called util-linux under Debian / Ubuntu Linux.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , ,

Previous post:

Next post: