setsid: Keep Linux / UNIX program running while you logs out
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.
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- strace and the GDB Debugger mini howto
- How do I monitor Linux/BSD system over time without scrolling output?
- nixCraft FAQ Roundup
- What are BogoMips
- How do I Monitor a slow UNIX or Linux system?
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: hangup, keep_running_command, nohup_command, setsid_command


Recent Comments
Today ~ 17 Comments
Today ~ 1 Comment
Today ~ 12 Comments
Today ~ 3 Comments
Today ~ 6 Comments