setsid — become a session leader then chain
setsid
{next-prog
}
Some operating systems come with a setsid command that does not chain, but that instead (often) spawns its target as a child process. This command does not ever fork a child process, and so is suitable for use in supervised command chains run under control of a daemon supervisor.
setsid is a chain-loading utility that attempts to become a
session leader and then chain loads to next-prog
with the
execvp(3)
function.
next-prog
may contain its own command line options, which setsid will ignore.
setsid does not perform chicanery with fork(2). If the process is not permitted to become a session leader, or if the process already is a session leader, the program fails.