IPB
>  Man Pages > Unix > Solaris 10 11/06 > Section 1 > nohup man page

nohup man page

Section 1 - Solaris 10 11/06 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!





User Commands                                            nohup(1)



NAME
     nohup - run a command immune to hangups

SYNOPSIS
     /usr/bin/nohup command [argument...]

     /usr/bin/nohup -p [-Fa] pid [pid...]

     /usr/bin/nohup -g [-Fa] gpid [gpid...]

     /usr/xpg4/bin/nohup command [argument...]

DESCRIPTION
     The nohup utility invokes the named command with  the  argu-
     ments supplied.  When the command is invoked, nohup arranges
     for the SIGHUP signal to be ignored by the process.

     When invoked with the -p or -g  flags,  nohup  arranges  for
     processes already running as identified by a list of process
     IDs or a list of process group IDs to become immune to hang-
     ups.

     The nohup utility can be used when it is known that  command
     takes  a  long  time to run and the user wants to log out of
     the terminal. When a shell exits, the system sends its chil-
     dren  SIGHUP  signals,  which  by  default  cause them to be
     killed. All stopped, running, and  background  jobs  ignores
     SIGHUP and continue running, if their invocation is preceded
     by the nohup command or if the process programmatically  has
     chosen to ignore SIGHUP.

     /usr/bin/nohup

         Processes run by /usr/bin/nohup  are  immune  to  SIGHUP
         (hangup) and SIGQUIT (quit) signals.



     /usr/bin/nohup -p [-Fa]

         Processes specified by ID are made immune to SIGHUP  and
         SIGQUIT,  and  all output to the controlling terminal is
         redirected to  nohup.out.  If  -F  is  specified,  nohup
         forces  control  of  each  process.  If -a is specified,
         nohup changes  the  signal  disposition  of  SIGHUP  and
         SIGQUIT  even if the process has installed a handler for
         either signal.



     /usr/bin/nohup -g [-Fa]




SunOS 5.10          Last change: 19 Jun 2006                    1






User Commands                                            nohup(1)



         Every process in the same process group as the processes
         specified  by  ID are made immune to SIGHUP and SIGQUIT,
         and all output to the controlling terminal is redirected
         to  nohup.out.  If -F is specified, nohup forces control
         of each process. If -a is specified, nohup  changes  the
         signal  disposition  of  SIGHUP  and SIGQUIT even if the
         process has installed a handler for either signal.



     /usr/xpg4/bin/nohup

         Processes  run  by  /usr/xpg4/bin/nohup  are  immune  to
         SIGHUP.

         The nohup utility does not  arrange  to  make  processes
         immune  to  a SIGTERM (terminate) signal, so unless they
         arrange to be immune to SIGTERM or the shell makes  them
         immune to SIGTERM, they will receive it.

         If nohup.out is not writable in the  current  directory,
         output  is  redirected  to $HOME/nohup.out. If a file is
         created, the file has read and  write  permission  (600.
         See chmod(1). If the standard error is a terminal, it is
         redirected to the standard output, otherwise it  is  not
         redirected.  The priority of the process run by nohup is
         not altered.



OPTIONS
     The following options are supported:

     -a       Always changes the  signal  disposition  of  target
              processes. This option is valid only when specified
              with -p or -g.



     -F       Force. Grabs the target processes even  if  another
              process has control. This option is valid only when
              specified with -p or -g.



     -g       Operates on a list of process groups.  This  option
              is not valid with -p.



     -p       Operates on a list of processes. This option is not
              valid with -g.



SunOS 5.10          Last change: 19 Jun 2006                    2






User Commands                                            nohup(1)



OPERANDS
     The following operands are supported:

     pid             A decimal process ID to  be  manipulated  by
                     nohup -p.



     pgid            A decimal process group ID to be manipulated
                     by nohup -g.



     command         The name of a command that is to be invoked.
                     If the command operand names any of the spe-
                     cial   shell_builtins(1)   utilities,    the
                     results are undefined.



     argument        Any string to be  supplied  as  an  argument
                     when invoking the command operand.



USAGE
     Caution should be exercised when using the -F flag. Imposing
     two  controlling processes on one victim process can lead to
     chaos. Safety is assured only  if  the  primary  controlling
     process,  typically  a debugger, has stopped the victim pro-
     cess and the primary controlling process is doing nothing at
     the moment of application of the proc tool in question.

EXAMPLES
     Example 1: Applying nohup to pipelines or command lists

     It is frequently desirable to apply nohup  to  pipelines  or
     lists  of  commands.  This can be done only by placing pipe-
     lines and command lists in a single  file,  called  a  shell
     script. One can then issue:

     example$ nohup sh file

     and the nohup applies to everything in file.  If  the  shell
     script  file  is to be executed often, then the need to type
     sh can be eliminated by giving file execute permission.

     Add an ampersand and the contents of file  are  run  in  the
     background with interrupts also ignored (see sh(1)):

     example$ nohup file &




SunOS 5.10          Last change: 19 Jun 2006                    3






User Commands                                            nohup(1)



     Example 2: Applying nohup -p to a process

     example$ long_running_command &
     example$ nohup -p `pgrep long_running_command`

     Example 3: Applying nohup -g to a process group

     example$ make &
     example$ ps -o sid -p $$
        SID
     81079
     example$ nohup -g `pgrep -s 81079 make`

ENVIRONMENT VARIABLES
     See environ(5) for descriptions of the following environment
     variables  that affect the execution of nohup: LANG, LC_ALL,
     LC_CTYPE, LC_MESSAGES, PATH, NLSPATH, and PATH.

     HOME     Determine the path name of the user's  home  direc-
              tory:  if  the  output  file  nohup.out  cannot  be
              created in the current directory, the nohup command
              uses  the  directory  named  by  HOME to create the
              file.



EXIT STATUS
     The following exit values are returned:

     126      command was found but could not be invoked.



     127      An error occurred in nohup, or command could not be
              found



     Otherwise, the exit values of nohup are those of the command
     operand.

FILES
     nohup.out               The output file of the nohup  execu-
                             tion  if standard output is a termi-
                             nal and if the current directory  is
                             writable.



     $HOME/nohup.out         The output file of the nohup  execu-
                             tion  if standard output is a termi-
                             nal and if the current directory  is



SunOS 5.10          Last change: 19 Jun 2006                    4






User Commands                                            nohup(1)



                             not writable.



ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

  /usr/bin/nohup
     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Availability                | SUNWcsu                     |
    |_____________________________|_____________________________|
    | CSI                         | Enabled                     |
    |_____________________________|_____________________________|


  /usr/xpg4/bin/nohup
     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Availability                | SUNWxcu4                    |
    |_____________________________|_____________________________|
    | CSI                         | Enabled                     |
    |_____________________________|_____________________________|
    | Interface Stability         | Standard                    |
    |_____________________________|_____________________________|


SEE ALSO
     batch(1),  chmod(1),  csh(1),  ksh(1),  nice(1),   pgrep(1),
     proc(1),   ps(1),   sh(1),   shell_builtins(1),  signal(3C),
     proc(4), attributes(5), environ(5), standards(5)

WARNINGS
     If you are running the Korn shell  (ksh(1))  as  your  login
     shell,  and  have  nohup'ed jobs running when you attempt to
     log out, you are warned with the message:

     You have jobs running.

     You need to log out a second time to actually log out.  How-
     ever, your background jobs continues to run.

NOTES
     The C-shell (csh(1)) has a built-in command nohup that  pro-
     vides  immunity from SIGHUP, but does not redirect output to
     nohup.out. Commands  executed  with  `&'  are  automatically
     immune to HUP signals while in the background.





SunOS 5.10          Last change: 19 Jun 2006                    5






User Commands                                            nohup(1)



     nohup does not recognize command sequences. In the  case  of
     the following command,

     example$ nohup command1; command2

     the nohup utility applies only to command1. The command,

     example$ nohup (command1; command2)

     is syntactically incorrect.













































SunOS 5.10          Last change: 19 Jun 2006                    6





Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Wed Sep 12 11:25:10 GMT 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

CPAN man page (4196 hits)
(Suse Linux 10.1)

ssh man page (4111 hits)
(Suse Linux 10.1)

svn man page (2354 hits)
(FreeBSD 6.2)

startproc man page (1695 hits)
(Suse Linux 10.1)

adv_cap_autoneg man page (1445 hits)
(Solaris 10 11_06)

signal man page (1357 hits)
(Suse Linux 10.1)

sqlite3 man page (1329 hits)
(openSUSE 10.2)

netcat man page (1188 hits)
(Suse Linux 10.1)

pprosetup man page (1177 hits)
(Solaris 10 11_06)

lwptut man page (1105 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: Pyrenees Lift Passes :: Prototype Assembly Service :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum