Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Can I convert a foreground process to NOHUP ? Post 302671945 by alister on Sunday 15th of July 2012 10:37:42 AM
Old 07-15-2012
Quote:
Originally Posted by jlliagre
On Solaris 10 at least, you can use the nohup command afterwards nohup -p pid to prevent the running process to die when you leave your shell and to get its output in a file (nohup.out).
I wasn't aware that any systems provided such an interface. Thanks.

Looks like AIX supports it as well.
nohup Command

Hopefully the OP consulted his man pages soon after posting. Smilie

Regards,
Alister

---------- Post updated at 10:37 AM ---------- Previous update was at 09:06 AM ----------

If the script was started with bash or ksh93 (perhaps other shells as well), the disown built-in can be used. This ensures that the interactive shell won't send SIGHUP to that job's process group if its controlling terminal is closed (which is usually the source of a SIGHUP). Note that this does not modify any process' signal mask, so if a SIGHUP arrives from somewhere, the process will be terminated.

Regards,
Alister
This User Gave Thanks to alister For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

pid of nohup process

I want to print the pid of a nohup process to a file so later I can use the list of pid's in that file to stop the background processes again. I use ksh on AIXv5.3: nohup /start/script.ksh 1>/dev/null 2>&1 print $$ > .pid nohup /start/script2.ksh 1>/dev/null 2>&1 print $$ >> .pid But... (2 Replies)
Discussion started by: rein
2 Replies

2. UNIX for Advanced & Expert Users

make a foreground running process to run background without hang up

I've tried this a long time ago and was successful but could not remember how i did it. Tried ctrl+Z and then used bg % could not figure what i did after to keep it no hangup - not sure if used nohup -p pid, can u plz help me out if this can be done. Any help will be appreciated. (12 Replies)
Discussion started by: pharos467
12 Replies

3. Shell Programming and Scripting

Background and Foreground of a process within a script

I'm not sure if it is even possible but I figured if it was someone here would know how to do it... I am running a script which starts a bunch of processes in the background but there is one process I would like to bring back to the foreground when complete. Unfortunately the process that I... (2 Replies)
Discussion started by: ctruhn
2 Replies

4. UNIX for Advanced & Expert Users

nohup and background process

What is the difference between running a process using nohup and running a process in background ? Please explain (6 Replies)
Discussion started by: srksn
6 Replies

5. UNIX for Dummies Questions & Answers

bringing a process to the foreground

If i have a single file i would just press fg but if i have multiple files running in the backgound and want to bring a specific one to the foreground how would i do that? Thanks!! (1 Reply)
Discussion started by: JamieMurry
1 Replies

6. UNIX for Advanced & Expert Users

Bringing a nohup process to foreground

Hi, I have used nohup command to run a process in background. i ran successfully and i exit from that terminal. But when i login for the next time I am not able to see the process but it is working, since I am getting a e-mail alert for error issue. Please let me know how to bring that process... (3 Replies)
Discussion started by: mbguy
3 Replies

7. UNIX for Advanced & Expert Users

what is the diff b/w background and foreground process

What are all the difference between a Background and Foreground processes ?! A Background process does not have access to STDIN and OUT.. What else ? Is there any detailed description available somewhere ? (5 Replies)
Discussion started by: onequestion
5 Replies

8. Shell Programming and Scripting

How can put a background process to the foreground

Hi, guys: I am working on my own shell using c. When I put a process into the background, how can I put it back to the foreground using tcsetpgrp? Thanks (3 Replies)
Discussion started by: tomlee
3 Replies

9. Shell Programming and Scripting

How to detect that foreground process is waiting for input?

Hi, I have to create a script (ksh or perl) that starts certain number of parallel jobs (another scripts), each of them runs as a foreground process in a separate session. Plus I start monitoring job that has to determine if any of those scripts is expecting input from operator, and switch to... (4 Replies)
Discussion started by: andyh80
4 Replies

10. UNIX for Advanced & Expert Users

Running process in nohup

Hi All, I am facing issue in running a process in nohup. I ran a process in terminal since it is taking too long to complete I need to make it as background and nohup. I tried below and was able to make it in back ground 1. Cntrl + Z 2. bg I am using Korn Shell so disown is not working... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
NOHUP(1)						    BSD General Commands Manual 						  NOHUP(1)

NAME
nohup -- invoke a utility immune to hangups SYNOPSIS
nohup [--] utility [arguments] DESCRIPTION
The nohup utility invokes utility with its arguments and at this time sets the signal SIGHUP to be ignored. If the standard output is a ter- minal, the standard output is appended to the file nohup.out in the current directory. If standard error is a terminal, it is directed to the same place as the standard output. Some shells may provide a builtin nohup command which is similar or identical to this utility. Consult the builtin(1) manual page. ENVIRONMENT
The following variables are utilized by nohup: HOME If the output file nohup.out cannot be created in the current directory, the nohup utility uses the directory named by HOME to create the file. PATH Used to locate the requested utility if the name contains no '/' characters. EXIT STATUS
The nohup utility exits with one of the following values: 126 The utility was found, but could not be invoked. 127 The utility could not be found or an error occurred in nohup. Otherwise, the exit status of nohup will be that of utility. SEE ALSO
builtin(1), csh(1), signal(3) STANDARDS
The nohup utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. BUGS
Two or more instances of nohup can append to the same file, which makes for a confusing output. BSD
July 19, 2001 BSD
All times are GMT -4. The time now is 04:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy