Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to keep program running after logout Post 302726187 by lepetal on Saturday 3rd of November 2012 08:14:26 PM
Old 11-03-2012
Quote:
Originally Posted by bakunin
That depends on your OS. AIX's nohup, for instance, can take a PID as argument and disattach the process from the terminal even after the start. This is probably possible in some other OSes too.

I hope this helps.

bakunin
Thanks Smilie At this point in the topic we are talking about Linux. In Linux we don't have -p key in nohup.
 

10 More Discussions You Might Find Interesting

1. Programming

Running a compiled Program

Just getting into the Unix command line programming and am unable to run any program I write. I am using a Makefile and the source is compiling but when I enter the name of the output file I get back: bash: lab01exe.out: command not found I'm sure I am just dooing something simple... (2 Replies)
Discussion started by: Krebsbac
2 Replies

2. Shell Programming and Scripting

Running a program automatically

How can I make a program run automatically at a certain time of day? My problem is I need to make a small backup program that will back up a few files every day? (3 Replies)
Discussion started by: jvadn0
3 Replies

3. UNIX for Dummies Questions & Answers

Running a program

Hi.Iam new to Linux.i got linux 7.0 pro and dont know how to run programs. I want a perl interputer and i know i installed one but how do i run it ??? Also how do i run a C or C++ editor ?and how do i run cron ? (3 Replies)
Discussion started by: perleo
3 Replies

4. Programming

running a program for a specified time

how can i run a program for a specified time? i need to print a current time during program execution. (3 Replies)
Discussion started by: prosputko
3 Replies

5. Shell Programming and Scripting

Keep process running (wget) and logout

well, i have only been learning about linux, unix and shells for a few days. For my online game to work, i need run a file each 10 seconds. Running that file will update mysql data, causing my online game to "tick". This adds resources and fights battles in game. I know that i need to use a... (3 Replies)
Discussion started by: mikey1090
3 Replies

6. Programming

Running app after logout and monitoring

Hello! I just programmed a very simple app, it's function is to report every minute the state of the memory and cpu and put it to and xml. All this stuff is working ok since I'm logged in into the machine, but i want it to run as a service, how can I do that?? P.S: Any one knows how can I... (1 Reply)
Discussion started by: ncatdesigner
1 Replies

7. UNIX for Dummies Questions & Answers

Running a program (Dynflow)

Lets get some stuff out of the way before the question. I am currently running FreeBSD 7.0 on a VirtualBox virtual machine. I do not know much about Unix or FreeBSD, though I do run linux at home. My boss gave me some files that he says are a unix version of the program Dynflow. The Programs... (0 Replies)
Discussion started by: poet_will
0 Replies

8. UNIX for Dummies Questions & Answers

Keep process running on logout

Hey All, I'm logging in via an SSH shell. I'm wondering if there's a way to execute a command and it not die when I close my terminal window (or rather, logout of the SSH shell). Thanks, Nathan (3 Replies)
Discussion started by: NathanWarden
3 Replies

9. Shell Programming and Scripting

Help with Running More than One Program

Folks, I'm really new to scripting and was wondering if you could help me out. I have the following script that I inherited: #!/bin/bash # # Usage # From the agent directory: # ./run-any-agent AgentName # TAC_AGENT_HOME=`pwd` LIB=${TAC_AGENT_HOME}/lib CLASSPATH=.... (17 Replies)
Discussion started by: DTriniWay
17 Replies

10. Shell Programming and Scripting

Running a program using csh

I have a program which I can run on the command line like below and works fine /nethome/chrisd/HSeis/TommyCD/TommyCD-1101/bin/raytrac vmod=npt10-z30.vmod srfile=jcdint.sc rcfile=jcdint.rc phases="SP FS" level=twop format="X T" dtau=0.1 mdacc=0.5 mindist=0.1 maxitertp=25 ray=npt10-z30.ry... (0 Replies)
Discussion started by: kristinu
0 Replies
runsv(8)						      System Manager's Manual							  runsv(8)

NAME
runsv - starts and monitors a service and optionally an appendant log service SYNOPSIS
runsv service DESCRIPTION
service must be a directory. runsv switches to the directory service and starts ./run. If ./run exits and ./finish exists, runsv starts ./finish. If ./finish doesn't exist or ./finish exits, runsv restarts ./run. If ./run or ./finish exit immediately, runsv waits a second before starting ./finish or restarting ./run. Two arguments are given to ./finish. The first one is ./run's exit code, or -1 if ./run didn't exit normally. The second one is the least significant byte of the exit status as determined by waitpid(2); for instance it is 0 if ./run exited normally, and the signal number if ./run was terminated by a signal. If runsv cannot start ./run for some reason, the exit code is 111 and the status is 0. If the file service/down exists, runsv does not start ./run immediately. The control interface (see below) can be used to start the ser- vice and to give other commands to runsv. If the directory service/log exists, runsv creates a pipe, redirects service/run's and service/finish's standard output to the pipe, switches to the directory service/log and starts ./run (and ./finish) exactly as described above for the service directory. The standard input of the log service is redirected to read from the pipe. runsv maintains status information in a binary format (compatible to the daemontools' supervise program) in service/supervise/status and service/log/supervise/status, and in a human-readable format in service/supervise/stat, service/log/supervise/stat, service/supervise/pid, service/log/supervise/pid. CONTROL
The named pipes service/supervise/control, and (optionally) service/log/supervise/control are provided to give commands to runsv. You can use sv(8) to control the service or just write one of the following characters to the named pipe: u Up. If the service is not running, start it. If the service stops, restart it. d Down. If the service is running, send it a TERM signal, and then a CONT signal. If ./run exits, start ./finish if it exists. After it stops, do not restart service. o Once. If the service is not running, start it. Do not restart it if it stops. p Pause. If the service is running, send it a STOP signal. c Continue. If the service is running, send it a CONT signal. h Hangup. If the service is running, send it a HUP signal. a Alarm. If the service is running, send it a ALRM signal. i Interrupt. If the service is running, send it a INT signal. q Quit. If the service is running, send it a QUIT signal. 1 User-defined 1. If the service is running, send it a USR1 signal. 2 User-defined 2. If the service is running, send it a USR2 signal. t Terminate. If the service is running, send it a TERM signal. k Kill. If the service is running, send it a KILL signal. x Exit. If the service is running, send it a TERM signal, and then a CONT signal. Do not restart the service. If the service is down, and no log service exists, runsv exits. If the service is down and a log service exists, runsv closes the standard input of the log service, and waits for it to terminate. If the log service is down, runsv exits. This command is ignored if it is given to service/log/supervise/control. Example: to send a TERM signal to the socklog-unix service, either do # sv term /etc/service/socklog-unix or # printf t >/etc/service/socklog-unix/supervise/control printf(1) usually blocks if no runsv process is running in the service directory. CUSTOMIZE CONTROL
For each control character c sent to the control pipe, runsv first checks if service/control/c exists and is executable. If so, it starts service/control/c and waits for it to terminate, before interpreting the command. If the program exits with return code 0, runsv refrains from sending the service the corresponding signal. The command o is always considered as command u. On command d first service/control/t is checked, and then service/control/d. On command x first service/control/t is checked, and then service/control/x. The control of the optional log service cannot be customized. SIGNALS
If runsv receives a TERM signal, it acts as if the character x was written to the control pipe. EXIT CODES
runsv exits 111 on an error on startup or if another runsv is running in service. runsv exits 0 if it was told to exit. SEE ALSO
sv(8), chpst(8), svlogd(8), runit(8), runit-init(8), runsvdir(8), runsvchdir(8), utmpset(8) http://smarden.org/runit/ AUTHOR
Gerrit Pape <pape@smarden.org> runsv(8)
All times are GMT -4. The time now is 12:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy