Sponsored Content
Top Forums Shell Programming and Scripting Background process, return code and pid. Post 302546957 by jim mcnamara on Friday 12th of August 2011 03:39:32 PM
Old 08-12-2011
Or in the remote .profile or .bashrc use TMOUT=n where n is the number of idle seconds before the process gets killed. You probably should set TMOUT as readonly, which is shell dependent.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PID of process started in background??

I am having a problem getting the PID of a process I start in the background is a csh. In tcsh and sh it's simple $! give it to you But in csh this just returns Variable syntax From the man page it should work but it doesn't???? Any help. (2 Replies)
Discussion started by: stilllooking
2 Replies

2. Shell Programming and Scripting

background process return code

Hi I have the following piece of code that is calling another child process archive.ksh in the background while read file; do file_name=`ls $file`; ksh archive.ksh $file_name &; done < $indirect_file The problem is, indirect_file may contain anwhere from 2 to 20 different... (5 Replies)
Discussion started by: Vikas Sood
5 Replies

3. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies

4. Shell Programming and Scripting

Return code of background process

Hi, I have a process that I run in the background that looks like this ${BASEDIR}/ksh/sqler.ksh ${compnames003} & and I would like to get the return code of the sqler.ksh script. so my code is like this ${BASEDIR}/ksh/sqler.ksh ${compnames003} & retcode=$? (3 Replies)
Discussion started by: c19h28O2
3 Replies

5. Shell Programming and Scripting

does the pid of background process show in /proc?

Hi all, I'm reading <advanced bash scripting> and there is a example to kill a background process in a limited time,as shown below: #! /bin/bash #set -n TIMEOUT=$1 count=0 hanging_jobs & { while ((count < TIMEOUT));do eval ' && ((count = TIMEOUT))' ((count++)) sleep 1... (6 Replies)
Discussion started by: homeboy
6 Replies

6. Shell Programming and Scripting

[SOLVED] Using "$!" to get the PID of the Last Ran Background Process

Hello All, I was looking into creating a script that would be used only to start a Daemon and create a lock file... F.Y.I. It's for Nagios' NRPE Daemon Plugin... Anyway when I run the command to start the Daemon (below): /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d And... (14 Replies)
Discussion started by: mrm5102
14 Replies

7. Shell Programming and Scripting

Catch exit code of specific background process

Hi all, i hava a specific backgroud process. I have de PID of this process. At some time, the process finish his job, is there any way to catch the exit code? I use "echo $?" normally for commands. Thanks! (2 Replies)
Discussion started by: Xedrox
2 Replies

8. Shell Programming and Scripting

Capturing the return code from background process

Hi All, I was out not working on unix from quite sometime and came back recently. I would really appreciate a help on one of the issue I am facing.... I am trying to kick off the CodeNameProcess.sh in PARALLEL for all the available codes. The script runs fine in parallel. Let say there are... (1 Reply)
Discussion started by: rkumar28
1 Replies

9. Shell Programming and Scripting

Pass return value of a function in background process

Hi, I have created a function f1 defined in script A.sh .I have called this function in background . But I want to use its return value for another function f2 in script A.sh. I tried declaring it as a global variable, yet it always returns the status as 0. Is there any way with which I can get... (7 Replies)
Discussion started by: ashima jain
7 Replies

10. Shell Programming and Scripting

How to return from background process and check if it is running or not?

Hi Team, i am executing 3 scripts in background from 1 script and i want to send a message once the script gets completed.these scripts usually takes 1 hr to complete. My sample script is below, Vi abc.sh sh /opt/data/Split_1.sh & sh /opt/data/Split_2.sh & sh /opt/data/Split_3.sh & ... (3 Replies)
Discussion started by: raju2016
3 Replies
autolog.conf(5) 						File Formats Manual						   autolog.conf(5)

NAME
autolog.conf - Configuration file for the autolog command DESCRIPTION
The configuration file consists of multiple lines, each of which describes a class of processes subject (or not subject) to a certain auto logout procedure. A line consists of any number of switches. Value switches are of the form: "name=value". Boolean switches are of the form: "name" or "noname". Using these switches, you can define a username, a group, and a tty line. These descriptions can contain wildcard characters (regular expressions). You can also define an idle time, a grace period and a few other options. When reading the configuration file, the program creates a record for each configuration line. A value is assigned to each variable in the record regardless of whether or not you specify one explicitly. Values for missing variables are provided by defaults which are compiled in and can be modified from the command line. If no entries are found matching a given process, that process will be spared from an untimely demise. Therefore, it is a good idea to always have a "cleanup" line at the end of the configuration file to catch anything that might have been missed by the more explicit defi- nitions. Since the default name, group, and line are all ".+", a simple line like: idle=30 will do. Actually, any one switch can be specified on the line and all the others will get the default values. If no configuration file is found, the program will create a single entry which has all values set from the defaults. This entry will match any process on any port (name=.+ line=.+ group=.+). Therefore, the default action is to kill all processes. ENTRYS
name= A regular expression specifying which username(s) to match. group= A regular expression specifying which group(s) to match. line= A regular expression specifying which tty line(s) to match. Omit the "/dev/" part of the special name. idle= An integer specifying the number of --minutes-- of idle (or connect) time to allow before beginning automatic logoff. An idle time of 0 exempts the process from automatic logoff. grace= An integer specifying the number of --seconds-- from the initial warning to killing the process. ban= An integer specifying the number of --minutes-- from killing the process to the moment, the user may login again. (after exceeding his session). hard A boolean value indicating total connect time will be considered rather than idle time. mail A boolean value indicating that mail will be sent to the user explaining that he was killed. clear A boolean value indicating that the screen will be cleared before a warning message is sent. warn A boolean value indicating that a warning message will be sent at the beginning of the "grace" period. log A boolean value indicating that activities will be logged to the logfile (if it exists). FURTHER ENTRYS
There is another group of entries, which allows to set some general options. Each of them takes a whole line. Don't mix them with the other entries from before. nolostkill A boolean value indicating whether lost processes should be killed. If there is a process with uid between 500 and 60000 and the owner is not logged in, it is assumed as lost and will be killed. ps=command on some strange or old systems the ps-command has different parameters. This makes it possible to set a completely different com- mand. It is only important, that this command delivers one heading line and then lines with usernames and process-ids (pid). e.g.: ps=ps aux EXAMPLE
name=root line=tty[1-7] idle=0 name=guest idle=5 grace=60 nomail hard warn group=lynx-.* idle=10 grace=60 clear idle=60 grace=30 AUTHOR
Kyle Bateman <kyle@actarg.com> (autolog 0.35), Carsten Juerges <juerges@cip-bau.uni-hannover.de> (autolog 0.40) This manual page was modified for Debian by Paul Telford <pxt@debian.org> Linux Configuration Files autolog.conf(5)
All times are GMT -4. The time now is 10:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy