Get the App
SLTechnology News&Howtos  ›  Servers  › 

Use the setsid command of linux to run the program in a new session

Shulou Source: shulou.com Published: 2022-06-02 15:52:25 09月22日 Update

This article will explain in detail about running the program in a new session using linux's setsid command. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The setsid command child process inherits from the parent process: SessionID, process group ID, and open terminal. If a child process wants to break away from this, it can be done by calling setsid in the code.

You can run a program on the command line or in a script by using the command setsid. Setsid helps a process break away from open terminals, process groups, and sessions inherited from the parent process.

Syntax format: setsid [parameters]

Common parameters:

Reference example

Run programs and commands in a new session:

[root@linuxcool ~] # setsid ping www.linuxprobe.com [root@linuxcool ~] # ps-ef | grep www.linuxprobe.comroot 31094 10 07:28? 00:00:00 ping www.linuxprobe.comroot 31102 29217 0 07:29 pts/4 00:00:00 grep www.linuxprobe.com on the use of linux setsid command to run the program to share here in the new session, I hope the above can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Processes commands programs runs new meetings parameters more articles terminals references help good practical code content can be passed examples commonly used articles formats Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Docker MySQL Linux Redmi