02-27-2015
Do you have the setsid utility?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi!
I want to run a script in parallel with different arguments.
eg.
start
script.sh argA script.sh argB script.sh argC
end
Can someone please tell how to achieve this.
Thanks in advance. (4 Replies)
Discussion started by: dummyix
4 Replies
2. Shell Programming and Scripting
Scenario:
I have two PCs (named as A & B) which would send some traps to my third PC (named as C).
In PC C, I have to write a shell script such that it should accept the datas from both the PC-A & B parallely.
So my question is, is it possible to have two different child threads/tasks... (2 Replies)
Discussion started by: nthiruvenkatam
2 Replies
3. Shell Programming and Scripting
Hello
I am trying to run a python program using shell script, which takes a single argument from a file.
This file has one entry per line :
1aaa
2bbb
3ccc
4ddd
5eee
...
...
...
My shell script runs the program, only for the last entry :
#!/bin/sh
IFS=$'\n'
for line in $(cat... (2 Replies)
Discussion started by: ad23
2 Replies
4. UNIX and Linux Applications
I would like to call a function called CIRCLE which is further beind called by other function but in a loop that CIRCLE fuction is being called. And this CIRCLE function starts another process which takes 3 hours to complete again, if i put that process in nohup &, I can go to the next command... (2 Replies)
Discussion started by: venugopalsmartb
2 Replies
5. Shell Programming and Scripting
Hello Everyone,
How do we run vi/vim encrypted shell script without decryption on multiple servers. It is a simple bash script and vim -nx <filename> has been used to encrypt with desired password. Now I have few errors, the syntax is absolutely fine as I have run that script multiple times on... (0 Replies)
Discussion started by: lovesaikrishna
0 Replies
6. Shell Programming and Scripting
How we can run the multiple instances of the script? I need to run the script which I am calling from the below function.I can doit with cron but I don't want to put it in the cron.This cript dploy the build and here I want when the build stage then it should run with multilpe instances of... (6 Replies)
Discussion started by: anuragpgtgerman
6 Replies
7. UNIX for Advanced & Expert Users
Hi,
I have a requirement to process multiple files in a directory parallely.Consider the below scenario:
In a directory there are three files file1,file2 and file3.When I use for loop each file will be executed in sequence but I want to process parallely.
Any Help would be appreciated.... (1 Reply)
Discussion started by: liyakathali
1 Replies
8. Shell Programming and Scripting
Hi Experts,
I have a list of Dbs.In that DBs i need to execute some sql scripts.
each sql script is unique and it should run on particular DB only.
For example. i have DBs like MDC20V,NDC20V,ODC20V and sql scripts like MD.sql,ND.sql,OD.sql.so MD.sql should run only in MDC20V and ND.sql should... (1 Reply)
Discussion started by: navsan420
1 Replies
9. Shell Programming and Scripting
Hi ,
I have 4 scripts example script1,script2,script3,script4 .
I have to run script1,script2 and script3 parallely since this 3 scripts dont have dependencies .
Once script1,script2 and script3 got completed successfully , I have to trigger script4.
Can someone help me on this how to... (10 Replies)
Discussion started by: vinothsekark
10 Replies
10. Shell Programming and Scripting
I have multiple jobs and each job dependent on other job.
Each Job generates a log and If job completed successfully log file end's with JOB ENDED SUCCESSFULLY message and if it failed then it will end with JOB ENDED with FAILURE.
I need an help how to start.
Attaching the JOB dependency... (3 Replies)
Discussion started by: santoshkumarkal
3 Replies
setsid(2) System Calls setsid(2)
NAME
setsid - create session and set process group ID
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
pid_t setsid(void);
DESCRIPTION
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.
RETURN VALUES
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.
ERRORS
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.
ATTRIBUTES
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.10 21 Aug 2002 setsid(2)