setsid(2) System Calls Manual setsid(2)NAME
setsid - create session and set process group ID
If the calling process is not a process group leader, creates a new session. The calling process becomes the session leader of this new
session, it becomes the process group leader of a new process group, and it has no controlling terminal. The process group ID of the call-
ing process is set equal to the process ID of the calling process. The calling process is the only process in the new process group and
the only process in the new session.
Some or all of the actions associated with this system call may require privileges. See privileges(5) for more information.
Upon successful completion, returns the value of the new process group ID of the calling process. Otherwise, it returns a value of and
sets to indicate the error.
If fails, no changes occur and (see errno(2)) is set to one of the following values:
The calling process is already a process group leader, or
the process group ID of a process other than the calling process matches the process ID of the calling process.
The calling process does not have sufficient privileges.
was developed by HP and AT&T.
SEE ALSO exec(2), exit(2), fork(2), getpid(2), kill(2), setpgid(2), setpgrp(2), setpgrp3(2), signal(2), privileges(5), termio(7).
STANDARDS CONFORMANCE setsid(2)
Check Out this Related Man Page
setsid(2) System Calls setsid(2)NAME
setsid - create session and set process group ID
The setsid() function creates a new session, if the calling process is not a process group leader. Upon return the calling process will be
the session leader of this new session, will be the process group leader of a new process group, and will have no controlling terminal. The
process group ID of the calling process will be set equal to the process ID of the calling process. The calling process will be the only
process in the new process group and the only process in the new session.
Upon successful completion, setsid() returns the value of the process group ID of the calling process. Otherwise it returns (pid_t)-1 and
sets errno to indicate the error.
The setsid() function will fail if:
EPERM The calling process is already a process group leader, or the process group ID of a process other than the calling process
matches the process ID of the calling process.
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Interface Stability |Standard |
|MT-Level |Async-Signal-Safe |
SEE ALSO getsid(2), setpgid(2), setpgrp(2), attributes(5), standards(5)WARNINGS
A call to setsid() by a process that is a process group leader will fail. A process can become a process group leader by being the last
member of a pipeline started by a job control shell. Thus, a process that expects to be part of a pipeline, and that calls setsid(), should
always first fork; the parent should exit and the child should call setsid(). This will ensure that the calling process will work reliably
when started by both job control shells and non-job control shells.
SunOS 5.11 21 Aug 2002 setsid(2)
inside my script s1.sh i am calling another script s2.sh
After s2.sh finishes, i want to print the process id of the s2.sh (that was used)
I can't use ps -ef command, since by this time s2.sh has already finished.
Is there a way to capture pid of s2.sh right when it's called?
I don't... (8 Replies)
On HP-UX, in application, if the process id has been get with the getpid() and sotred in database, then other monitor process want to check it if the process is existed, are there any system function can do it? I do not want to use the shell script, because it should use popen function to excuted... (5 Replies)
This is chanikya
Is there any System call which behaves just like fork but i dont want to return back two times to the calling func.
In the following ex iam creating a child process in the called func but the ex prints two times IN MAIN.
main()... (4 Replies)
I have a problem and i was hoping that you guys could help me out
I want to copy a user privileges to a group and i need to copy all privileges(Recursively) every directory with all its sub directories and I tried some solution and it did not work. I used the following command:-
... (14 Replies)
i want shell script who can eliminate those repeated process and get value of top process of second column.
Mark with red one only i want other repeated process should be eliminate but how? Help me out guys.
ko9coll 96157... (4 Replies)
I am trying to find the process id of the subsequent process created via fork and exec calls in perl.
envVarSetter dataCruncher.exe < input.txt > output.txt
When I fork and exec the above command,
it returns only the pid of envVarSetter and I don't know how to find the... (9 Replies)
When I use procstack <processid> this is what I get:
procstack: <processid> is not a process
What is the definition of an AIX process? Isn't everything that the ps -ef command shows, a process? (5 Replies)
Special group and user privileges help
I'm having some trouble understanding the group and user privileges.
So let's say I make a group.. and assign some users to the groups that I made.
How would I --
1) Allow different groups and different users to have full privileges over a file with .X... (5 Replies)
I have a list of application process id's.
Is there a way to kill all the process listed below using the script, except the once which are starting with " Genesis "
adm 1522 ABC_Process.tra
adm 1939 Genesis_Process.tra
adm 2729 Genesis_Archive.tra
adm 3259 xyz_Process.tra (5 Replies)
We want to create a script in order to filter process in the system with more than five days (STIME) and then kill them under Solaris 10.
How can we filter these kind of process ?
Thanks in advance for your help (4 Replies)
We have a process which is running for last 2 years well and good in production. But suddenly yesterday there was issue we faced in the process.
The actual process is what it does like below.
1. Receive the files in NAS directory(N/w attached storage).
2. Trigger the... (11 Replies)