|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can I convert a foreground process to NOHUP ?
OS : AIX 6.1/Solaris 10 After I started running a shell script, I've realized that it will take another 5 hours to complete. Is there anyway I could convert this foreground process to run in nohup mode so that I can go home peacefully ? I have the process ID Code:
$ ps -ef | grep myschellscript_process nbkp_usr 3461298 1 0 17:17:54 - 1:03 myschellscript_process |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Usually ctrl-Z is mapped to susp in stty for a terminal.. so pressing that suspends the running foreground job and it gets a job number... then you can can use the "bg" command to background it. HOWEVER... if the foreground process is tied to tty input... it will block on i/o... so not everything can be successfully backgrounded... I don't see that problem in your case though.
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Quote:
Regards, Alister ---------- Post updated at 11:29 PM ---------- Previous update was at 11:27 PM ---------- I just realized that you responded to a month-old thread. I hope the original poster got some sleep that night. Regards, Alister |
|
#4
|
|||
|
|||
|
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).
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Quote:
Looks like AIX supports it as well. nohup Command Hopefully the OP consulted his man pages soon after posting. ![]() 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 |
| The Following User Says Thank You to alister For This Useful Post: | ||
methyl (07-15-2012) | ||
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can put a background process to the foreground | tomlee | Shell Programming and Scripting | 3 | 03-02-2011 11:26 PM |
| what is the diff b/w background and foreground process | onequestion | UNIX for Advanced & Expert Users | 5 | 02-24-2010 02:07 AM |
| Bringing a nohup process to foreground | mbguy | UNIX for Advanced & Expert Users | 3 | 05-25-2009 07:18 AM |
| bringing a process to the foreground | JamieMurry | UNIX for Dummies Questions & Answers | 1 | 04-12-2009 10:54 AM |
| Background and Foreground of a process within a script | ctruhn | Shell Programming and Scripting | 2 | 10-06-2008 09:34 AM |
|
|