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
0
votes
0 answers

How to run a shell script with input parameters in background from another script in bash

I have a script which reads 2 input parameters as given below: #!/bin/bash echo -n "Input 1 : " read a echo -n "Input 2 : " read b nohup sh /path/script2.sh $a $b > custom-out.log & The script is executing. But not exiting It prints nohup:…
user1407668
  • 587
  • 5
  • 20
  • 35
0
votes
1 answer

Capistrano and Ubuntu Service

After a few days and much google searching, I have finally solved an issue of mine. I'm using Railsless-deploy (capistrano without the rails tasks/goodies) so I can deploy a project thats' not in rails. In order to start/stop/restart the server, I…
Allen
  • 794
  • 1
  • 6
  • 19
0
votes
1 answer

Environment variable in php script not working from nohup

I have php script which uses some environment variables using getenv from /etc/environment. It works fine when I run it from terminal using php command. But environment variables are not getting when running same script from nohup on terminal. PHP…
user1551373
  • 131
  • 1
  • 3
  • 5
0
votes
2 answers

Trying to kill a nohup process that changes PIDs

I list the PID and then try to kill it using: nohup server & kill However, I keep getting the error: nohup: failed to run command ‘server’: No such file or directory This is because the PID keeps changing! When I try to kill the current…
AllieCat
  • 3,890
  • 10
  • 31
  • 45
0
votes
1 answer

perl script to monitor & restart listener hangs on nohup waiting for carriage return

I have a tcp/ip listener written in java that is run for multiple 'sites' each with their own port. The developer who wrote this listener did so as a standalone so I have to manage each via a start_comtrol.sh script which is quite tedious. I'm new…
Jchieppa
  • 126
  • 1
  • 2
  • 9
0
votes
2 answers

Different behavior when PHP script executed through cron job

I have a script, let's call it mainfile.php that has an include in it for a file in the same directory. I am including it as follows: If I do the…
EastsideDev
  • 6,257
  • 9
  • 59
  • 116
0
votes
0 answers

Linux: rexec not working when redirecting output into nohup

I am able to execute rexec command in my terminal. If a execute the same as nohup sh rexec.sh it's not working. Command I used nohup sh rexec.sh Error I got in nohup.out rexec: Error in read from remote host: Bad file descriptor How can I fix…
kannanrbk
  • 6,964
  • 13
  • 53
  • 94
0
votes
1 answer

Alternative to nohup when input user is requested

I've got a java application which is started with a nohup command. Now the stop command is just a kill -15 of that application. This application is a file parsing and write to db application and it has a shutdown hooker which intercepts the kill…
BangTheBank
  • 809
  • 3
  • 11
  • 26
0
votes
3 answers

PHP exec with nohup

I currently use nohup to run a long php script and redirect the live results to a file using this command nohup php long_file.php >logs 2>&1 & so i just go and visit logs file continuously to see the results Now i want to do the exact same thing…
Osa
  • 1,922
  • 7
  • 30
  • 51
0
votes
1 answer

createTasks and createJob command in MATLAB does not work when using nohup?

I use the nohup command to run my matlab program on a remote machine. Since I have to run the same program by changing some input parameters I decided to try to utilize the parallel computing toolbox functions. I have the following matlab script,…
me10240
  • 125
  • 2
  • 7
0
votes
1 answer

Capturing python-background-processes output realtime

I have a simple long running python script which logs using print("text to log"). I want to run this as a background process but the output is only dumped into the specified log file when the process terminates. Is there a way to log in real time so…
user2177276
  • 3
  • 1
  • 2
0
votes
1 answer

PHP run python script every n seconds

I have a python script that I'd like to run every n seconds. I want to be able to start the script with a PHP page. I'd like it to run in the background so that I can visit my page, hit 'go', leave the page, come back in a few hours, and stop the…
Justin
  • 1,881
  • 4
  • 20
  • 40
0
votes
1 answer

nohup for loop output naming

I use for loop to use specific tool with the set of files: nohup sh -c 'for i in ~/files/*txt; do ID=`echo ${i} | sed 's/^.*\///'`; ./tool $i && mv output ${ID}.out; done' & This tool has specific naming for outputted files and I want to rename…
pogibas
  • 27,303
  • 19
  • 84
  • 117
0
votes
2 answers

Bash script runs into infinite loop. Why?

This init script shall start a service using nohup with the "start" parameter. All other parameters shall be passed as-is. (Restart is provided for convenience.) #!/bin/sh # Foo Startup…
Matthias Ronge
  • 9,403
  • 7
  • 47
  • 63
0
votes
1 answer

Unable to retrieve nohup process using fg

I was running a process from terminal in an SSH session and started the process in background with nohup and disconnected. After some time I log back on the server and see that process is still running but cannot bring it back to foreground with…
abhinavkulkarni
  • 2,284
  • 4
  • 36
  • 54