Questions tagged [background-process]
A 'background' process is a computer process that runs "behind the scenes" (i.e. in the background) and without user intervention. Typical tasks for using such processes include logging, system monitoring, scheduling, and user notification. Use this tag for any questions about background processes.
647 questions
5
votes
2
answers
462
views
Are some bash ambiguous job specs impossible to differentiate?
$ sleep 1234&
$ sleep 12345678&
$ %sleep\ 1234
bash: fg: sleep 1234: ambiguous job spec
$ jobs
[1]- Running sleep 1234 &
[2]+ Running sleep 12345678 &
...
0
votes
1
answer
36
views
Examining jobs submitted in other sessions
A semi-hypothetical question...i've logged into a machine remotely, set up a series of tasks along the lines of
sleep 36000 ; source myjob1 &
sleep 36000 ; source myjob2 &
(etc.) and then ...
7
votes
3
answers
892
views
Open pdf files in the background with fzf
I want to fzf through all the pdf files in a directory, open it and release the terminal.
I tried
PDF_READER=okular # or evince
find -type f -name "*.pdf" -print | fzf --print0 | xargs -0 $...
2
votes
0
answers
63
views
How to ensure processes/windows in background virtual terminals run?
I use two graphical virtual terminals (sessions) on a debian desktop with KDE (the ones you switch between using chvt or Ctr-Alt-F7, F8, etc.). I notice that processes in open windows in the inactive ...
4
votes
4
answers
568
views
How to wait for background commands that were executed within a subshell?
Given this code:
#!/bin/bash
set -euo pipefail
function someFn() {
local input_string="$1"
echo "$input_string start"
sleep 3
echo "$input_string end"
}
function ...
0
votes
1
answer
83
views
How to redirected output from disowned process to a file
A borgmatic backup command that runs for many hours:
long_running_cmd &> file.txt
I did Strg+Z then bg then disown to keep the command running I case my laptop goes to sleep or disconnects.
I ...
1
vote
1
answer
90
views
Process run with nohup gets killed on client_loop: send disconnect: Broken pipe
I have observed the following and want to understand why:
First, I run a Node server that listens on a port on a remote server using:
nohup my-app &
Next there are two cases:
I logout of the ...
1
vote
0
answers
196
views
How to wait the end of a non-child process?
I have here a not really fine app, partially out of my control. Sometimes it stops and I want to restart it, and some extra options.
So, if it exists, I want to start my script. Poor man solution ...
0
votes
2
answers
104
views
Why can't & and ; be used together (two processes started, first in the background)? [duplicate]
I tried this simple test
ping [SOME IP] &;ls
expecting the output of ping to overlap with the listing.
Instead, I got an error:
bash: syntax error near unexpected token `;'
It does not help ...
0
votes
0
answers
117
views
How Do SSH-Launched Long-Running Background Jobs Detach Without nohup or disown?
When running a long-running command in the background over SSH from a non-interactive shell script, I noticed the process continues running on the remote machine without using nohup, disown, or ...
2
votes
2
answers
138
views
Should launching background jobs cause a race condition?
I tested the following with both bash and dash, and it seems to reliably hang:
[ -p pipe ] || mkfifo pipe
i=0
while [ $i -lt 10 ]; do
<pipe cat &
: $(( i+=1 ))
done
# sleep 1
echo hello ...
0
votes
1
answer
146
views
Is it possible that systemctl process would not run without me being logged in to the server?
I am very new to linux and I need some help. I am trying to put blockchain node processes on the background so that they run without my being logged in.
I am using systemctl to run my process in the ...
2
votes
1
answer
363
views
Can one execute a function in background from a function that is already running in background?
Considering the following script:
if [[ -z "$DOWNLOAD_ONLY" || "$DOWNLOAD_ONLY" = *conditions* ]]; then
function get_condition {
curl -s "https://conditions.com" | ...
0
votes
1
answer
657
views
Systemd kills all background processes after ssh session ends despite all the typical solutions
I have tried almost every solution on Stack Exchange (except for nohup; it seems like that is not an ideal loophole), but Systemd still kills my background processes.
I also tried starting a Tmux ...
3
votes
0
answers
200
views
Understanding piping to a unix domain socket in the background
I have a Debian 12 (bookworm) host where I run three VMs using QEMU / KVM. To simplify VM management, each VM has a QEMU monitor socket. These sockets are /vm/1.sock, /vm/2.sock and /vm/3.sock. Among ...