Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [nohup]

nohup is a POSIX command to ignore the HUP (hangup) signal.

0
votes
1answer
95 views

How to prevent/keep tail from replacing \r by \n

When I play a video with mpv in the backgroud, I get this : $ tail -f nohup.out Playing: https://www.facebook.com/TBN/videos/1580372468665943/ (+) Video --vid=1 (*) (h264 1266x720 30.000fps) (+) ...
1
vote
1answer
28 views

Running a Command, that will not terminate upon closing terminal

I am trying to work with a remote device that I login to using SSH, the device uses MQTT for communication, and I want to be able to log that remotely without keeping a terminal open with the command ...
0
votes
1answer
32 views

WHy is my Nohup process dying?

What's wrong with this code? Suddenly the nohup process dies, without a trace. bin/sh sleep 5s cd /home/minecraft/OMC nohup java -jar -Xms3400M -Xmx3400M -jar paperclip.jar &
-1
votes
1answer
415 views

nohup: ignoring input and appending output to 'nohup.out'

I ran the following command nohup conda activate shuffle_pair_end_reads && python3 shuffle_pair_end_reads.py \ fastp-filtered-merged4racon/merge_R1.fq.gz \ fastp-filtered-merged4racon/...
0
votes
1answer
44 views

“nohup cat” — write the complete content to the log file rather to concatenate file

I used the below command nohup cat fastp-filtered/OZBenth*_R1.fastp.fq.gz > fastp-filtered-merged4racon/merge_R1.fq.gz > merge_R1.out.log 2>&1 & but unfortunately, the output went ...
1
vote
3answers
161 views

Issue with the exit code of a nohup command in unix

I have been trying to figure out on how to capture the exit status of the nohup command and then send a mail based on the status. Below is my code: if [[ "" != "$PID" ]]; then echo "killing $...
0
votes
0answers
94 views

pass function to nohup to keep command running

I have the following function set up which looks at a given directory and decompresses any files using qpress. It also records how long the process runs for. fc_decompress () { startTime="$(date +...
0
votes
2answers
210 views

Nohup: Redirect stderr to file and dismiss stdout

Per default, nohup writes stdout to nohup.out and dismisses stderr. I would like to have it the other way around: write stderr to a file and dismiss stdout.
0
votes
0answers
10 views

Prevent SIGINT from reaching mspdebug [duplicate]

For some debugging, I run mspdebug to create a gdb server and then start gdb, connect to mspdebug and start debugging. A normal part of using gdb is hitting CTRL+C, this interrupts the program flow ...
0
votes
1answer
125 views

[1]+ Exit 125 nohup [closed]

I am running the following command: nohup ./run_hyper_param_tuning.sh> ../../logs/hyper_model_15_b_Jan.txt 2>&1 & echo $! >save_pid.txt It has been always working but suddenly it ...
1
vote
1answer
196 views

No nohup logs on remote server

I'm trying to start a proccess on remote server with ssh. I need to log stdout on target server (not the local one) Here is the script: sshpass -p mypwd ssh root@myserver.com nohup java -jar /tmp/...
1
vote
0answers
29 views

Script get in process multiple times

I have a script that starts, kills or restarts several java programs. However, when I execute it, it ends up running multiple multiple times in the background. This is my script: #!/bin/bash export ...
0
votes
0answers
25 views

Terminal Hangs when running bot

I have a bot installed on my Azure Linux VM running Ubuntu 18.04. I am running the command to start my bot, and it returns an error (see below). The console freezes as well apparently because it ...
0
votes
0answers
30 views

-bash error when trying to run bot [duplicate]

I have a bot installed on my Azure Linux VM running Ubuntu 18.04. I am running the command to start my bot, and it returns an error (see below). $ nohup python3 bot.py > nohup_bot.out -bash: ...
1
vote
0answers
68 views

Program start from interactive shell fails when shell script initiated by launcher

[This post has been edited from the original text to add the results of further investigation and get to the point more quickly -- Thanks @ctrl-alt-delor] Why does this script: #!/bin/bash read -p "...
1
vote
1answer
65 views

Does nohup apply only to a child process of a shell process, but not to a child process of a non-shell process?

nohup is an external program. How can it change the action of SIGHUP by a child process of a shell process to be "ignore"? (in terms of some arguments when the child process invokes fork() and/or ...
16
votes
2answers
1k views

Do `disown -h` and `nohup` work effectively the same?

disown causes a shell not to send SIGHUP to its disowned job when the shell terminates, and removes the disowned job from the shell's job control. Is the first the result of the second? In other ...
0
votes
1answer
120 views

Automatically restarting a process when it dies?

I have a process running on a raspberry pi. After ssh ing into in to the process is started like this: nohup .../blah/blah & IIUC this allows me to log out of the pi and the process keeps ...
1
vote
1answer
258 views

Unable to write to file in shell script when running command in background

I have the following commands that need to be run in a shell script, nohup command >> help.out & When I run the script from terminal the nohup command runs in the background and the next ...
4
votes
2answers
166 views

No log content with tail but when terminating a process I see content with less

Basically, I am running: nohup ./executable &> /tmp/out.log & In order to make sure the process is running I ran the command: tail -f /tmp/out.log But the only thing I can get from tail ...
-1
votes
1answer
100 views

Use nohup and return to terminal and pipe to logger

I can redirect output to logger like this: nohup bin/mytask | logger But the process hangs, and my cursor doesn't return to the terminal after the command is sent. (I would have to return to ...
1
vote
2answers
47 views

Why application does not run from SCREEN without delay?

Suppose we need to run application in screen and keep it running when screen exits. The following command does the job, but only if "sleep 1" is appended to it. Why it does not work without "sleep 1"? ...
0
votes
1answer
295 views

Is there a difference between running a program as a daemon and using nohup with & to run the program?

I'm trying to run my program as a daemon but the way I am doing it currently requires root access. I was wondering if I could use the nohup command with & to push it to the background instead of ...
0
votes
2answers
576 views

Run a script every minute without cron and allowing children

I've written 2 php scripts one worker and one master. If I run master manually it checks a rabbitmq system and spawns 1 worker for each queue it detects. Then if I run master again it checks see if ...
0
votes
0answers
137 views

remote process run through ssh gets killed if UI is closed

I have written a script which essentially does 2 things: Runs a UI for listening to the actual program running on the server remotely run the program on the server All goes well, the UI starts, then ...
1
vote
2answers
67 views

Is it possible to execute a command on server even when I'm disconnected from remote?

Scenario I'm using cp to copy some very big folders, or using tar to compress some big folders. But I have very limited power on my laptop and can't find a power connection nearby. Question Is ...
1
vote
2answers
198 views

sudo nohup and redirection

Trying to figure out the correct Cmnd_Alias for the sudoers file The command i which to run without any password is the following: sudo /usr/bin/nohup /etc/init.d/axtty start >/dev/null 2>&...
0
votes
0answers
71 views

Why does nohup command interrupt?

I put a command in .bash_profile file. The command is: nohup stdbuf -oL -eL sysdig -c spy_users 1>>/path/to/out 2>>/path/to/err & While I am working on terminal it appears: [1]+ ...
0
votes
2answers
1k views

Get python process ID for a flask web site and/or port number?

I have some web applications that I wrote with python flask. I know which port I started each one on and each was started using nohup. Each one was started with something like nohup python mywebapp.py ...
0
votes
1answer
286 views

Do I really need to use nohup? [duplicate]

I would like to let run my script on background on my server. I red about nohup. I have my script.py. I run it like this: python3 script.py& It runs on background even when I close terminal. The ...
9
votes
1answer
3k views

Why nohup background process is getting killed?

I tried starting a shell script via a remote session, which starts a process in the background using the command. nohup python3 run.py > nohup.out & When the remote session is closed, the ...
2
votes
1answer
203 views

Does nohup try to arrange for the program not to have a controlling terminal?

Gilles said nohup and disown both can be said to suppress SIGHUP, but in different ways. nohup makes the program ignore the signal initially (the program may change this). nohup also tries to ...
0
votes
0answers
224 views

Why doesn't a Gradle with task to call npm install not work with nohup

I have a gradle app with the following task... task npm(type:Exec) { if(System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows")){ workingDir = "${projectDir}" ...
0
votes
3answers
370 views

Using nohup and time with different outputs

I want to run an executable main and redirect all outputs to /dev/null, meanwhile I measure its runtime with time and write the results to runtime.out. Since the task is long I also have to run the ...
0
votes
1answer
339 views

Can I run the nohup command from tcsh

I am looking into the nohup command and I am not sure which shells it support. It seems as if this program works differently in bash and tcsh. What I tried was something very simple. nohup --help ...
2
votes
1answer
1k views

Issues with “nohup” on Linux instance on EC2 Amazon Web Services

I am working on the Ubuntu system on Amazon Web Services EC2. I have created an instance and need to run a node.js server on the system. Once I ssh into my working directory and use the following ...
2
votes
0answers
189 views

Detached process still dies with parent [duplicate]

I am trying to detach a process completely from a bash script, and then kill the bash script with Ctrl+C and have the detached process keep running. My code currently looks like this: nohup ${SHELL} -...
4
votes
3answers
985 views

On the desktop with Bash, should I use '&', nohup, disown, or some combination of the three to start a process and have it run completely on its own?

When I run these four commands on Xubuntu 16.04, either locally or over ssh, they all seem to do the exact same thing: export DISPLAY=:0.0 #not necessary unless you have logged in over ssh instead of ...
4
votes
1answer
967 views

Syntax error in nohup (…)

I am trying to test the nohup command in the bash shell by executing a command in the background and logging out and back in again and expecting the output of the command to be in the nohup.out file. ...
2
votes
1answer
2k views

How do I wait for nohup jobs to finish within a shell script?

I have the following script: echo "$wk" | while read -r a b; do counter=$(($counter+1)) nohup sh -c 'impala-shell -d nielsen -f query.sql --var=dt=$a --var=incre=$b; echo $a,$?>>$...
1
vote
0answers
754 views

Remote copy via SCP doesn't work in background

The situation: I'm switching file servers at home. I want to copy tons of data from one Synology Disk Station to another. My Approach: #Via SSH on the new server: nohup scp -r ${old_server}:. . I ...
0
votes
1answer
76 views

How do I implement/enable blanket nohup in the shell?

Something like a shell option or "mode" that protects all GUI processes run within that session from being killed when I kill the shell. It would be the equivalent of using nohup for each of the ...
0
votes
1answer
2k views

nohup is not working as I am exiting the terminal

I was trying to use nohup like that: nohup python fibo.py & > a.out When I do so and try to exit from the shell it prompts that "you have running jobs". But that should not be the case. $ ...
-1
votes
1answer
382 views

Sometimes it's convenient to use ` read -t 3 ` instead of ` sleep 3 `. How do I make it work with `nohup`?

Sometimes it's convenient to use read -t 3 instead of sleep 3. How do I make it work with nohup? nohup bash -c ' date; read -t 3; date ' | tail -n 2 nohup.out As you can see, read -t 3 does not wait ...
1
vote
2answers
781 views

Running picocom in the background without open session

I would like picocom to log serial data on a remote computer, without having to keep my ssh session to the remote computer alive. I have tried: picocom <my options> This dies when I logout. ...
3
votes
1answer
5k views

Why process killed with nohup

I want to run a process in background without killing it on shell exit, according to Nohup concept the following command should work until I kill it manually: nohup uwsgi --http :8008 --module ...
0
votes
0answers
101 views

using nohup with virtualbox in terminal in x

When I start a VirtualBox virtual machine from a terminal within X, using nohup, the virtual machine closes after I exit out of X. This is confirmed by both listing virtual machines, and looking at ...
1
vote
1answer
1k views

for loop in nohup

I am trying to run bash script which run 8 for loops simulatenously. one of the my for loop likes below for i in 00 01 02 03 04 ; do cat $INDIR/sys*$1.$i*csv | awk -F '\xac' 'BEGIN{OFS=";";} ($4 == ...
1
vote
0answers
182 views

nohup ssh on osx

The following two commands (aligned to highlight syntactical changes), which differ only in the means by which commands are delivered to the shell, work fine on receivers running a variety of linux-...
2
votes
1answer
204 views

Pipe nohup output to logger w/ different priorities

I've got a third-party Python script to run in background using nohup. And instead of piping the output to a file I'd like the output to be appended to the system log using logger. Added to that I ...