Questions tagged [nohup]

nohup is a POSIX command to ignore the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out.

nohup is a POSIX command to ignore the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out. The HUP (hangup) signal is by convention the way a terminal warns depending processes of logout.

717 questions
26
votes
6 answers

Call a function using nohup

I am trying to call a function using nohup like this: function1(){ while true do echo "function1" sleep 1 done } nohup function1 & # ...... some other code but may be the function isn't seen by nohup and I get this…
sajad
  • 2,094
  • 11
  • 32
  • 52
23
votes
1 answer

nohup as background task does NOT return prompt

I am trying to run a long running task in the background without having to be logged in and have the terminal return a prompt, but when I do this, the task appears to go into the background, but my prompt does not become available unless I hit…
Chris Muench
  • 17,444
  • 70
  • 209
  • 362
23
votes
5 answers

How to run a command in background using ssh and detach the session

I'm currently trying to ssh into a remote machine and run a script, then leave the node with the script running. Below is my script. However, when it runs, the script is successfully run on the machine but ssh session hangs. What's the problem? ssh…
Progress Programmer
  • 7,076
  • 14
  • 49
  • 54
22
votes
6 answers

sudo nohup nice <-- in what order?

So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in? sudo nohup nice foo.bash & or nohup nice sudo foo.bash & etc. I suspect it doesn't matter but would like some insight from those who…
Jonah Braun
  • 4,155
  • 7
  • 29
  • 31
21
votes
2 answers

How bash handles the jobs when logout?

As far as I understood from the books and bash manuals is that. When a user logs out from bash all the background jobs that is started by the user will automatically terminate, if he is not using nohup or disown. But today I tested it : Logged in…
Unni
  • 1,721
  • 2
  • 14
  • 12
21
votes
1 answer

Redirect nohup's stderr to nohup.out

How do I run a command with nohup so that both the stdout and stderr are saved to nohup.out? By default only stdout is saved and stderr is discarded.
Timmmm
  • 88,195
  • 71
  • 364
  • 509
20
votes
4 answers

Starting background tasks with Capistrano

For my RubyOnRails-App I have to start a background job at the end of Capistrano deployment. For this, I tried the following in deploy.rb: run "nohup #{current_path}/script/runner -e production 'Scheduler.start' &", :pty => true Sometimes this…
Georg Ledermann
  • 2,712
  • 4
  • 31
  • 35
18
votes
4 answers

Using aliases with nohup

Why doesn't the following work? $ alias sayHello='/bin/echo "Hello world!"' $ sayHello Hello world! $ nohup sayHello nohup: appending output to `nohup.out' nohup: cannot run command `sayHello': No such file or directory (the reason I…
asf107
  • 1,118
  • 7
  • 22
18
votes
6 answers

How to include nohup inside a bash script?

I have a large script called mandacalc which I want to always run with the nohup command. If I call it from the command line as: nohup mandacalc & everything runs swiftly. But, if I try to include nohup inside my command, so I don't need to type it…
felipebm
  • 189
  • 1
  • 1
  • 4
18
votes
3 answers

Running process in background after closing terminal

I am trying to run a script in the background even after closing the terminal. I have searched and searched and tried nohup and disown but neither seem to be working. When I close a terminal window, I get the typical Closing this window will…
John Robins
  • 1,427
  • 3
  • 11
  • 10
17
votes
1 answer

python print statement with utf-8 and nohup

I have a some python code that prints log messages. When run at the command line, it does fine with utf-8. Log messages that contain special characters print out fine. However, when run in the background under nohup, it barfs on utf-8…
Ernst
  • 173
  • 1
  • 4
17
votes
2 answers

How can I start a remote service using Terraform provisioning?

I want my Terraform config to provision a server and start the service at the end by invoking a command and keep running it. I tried using nohup and screen using remote-exec: nohup: provisioner "remote-exec" { inline = "nohup sudo command…
snorberhuis
  • 3,108
  • 2
  • 22
  • 29
17
votes
3 answers

Python - nohup.out don't show print statement

Im new to python and web development, I have a basic issue I believe. I'm running my server with pyramid, and I use nohup.out to write output to a file. nohup ../bin/pserve development.ini When I do tail -f nohup.out I can see all the output…
Mario
  • 2,431
  • 6
  • 27
  • 34
16
votes
3 answers

nohup VERBOSE=1 perl script.pl

I have a perl script for which ENV variables can be set to direct specific outputs e.g. $debug, $verbose, $develop etc Usually I run these from the command line $ VERBOSE=1 perl myperlscript.pl params I now want to run them using nohup. Using the…
bobox
  • 359
  • 3
  • 16
15
votes
5 answers

Unable to start service with nohup due to 'INFO spawnerr: unknown error making dispatchers for 'app_name': EACCES'

I'm trying to start a service with supervisor, but I get an error saying INFO spawnerr: unknown error making dispatchers for 'app_name': EACCES Here's my supervisord.conf file: [supervisord] logfile=/tmp/supervisord.log logfile_maxbytes=50MB ;…
user4414636
1
2
3
47 48