Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
30 views

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 ...
ionh's user avatar
  • 183
7 votes
3 answers
874 views

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 $...
glacier's user avatar
  • 491
2 votes
0 answers
60 views

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 ...
cseprog's user avatar
  • 371
4 votes
4 answers
551 views

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 ...
k0pernikus's user avatar
  • 16.7k
0 votes
1 answer
78 views

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 ...
Destro's user avatar
  • 15
1 vote
1 answer
82 views

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 ...
morpheus's user avatar
  • 135
1 vote
0 answers
190 views

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 ...
peterh's user avatar
  • 10.5k
0 votes
2 answers
97 views

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 ...
Peter Bill's user avatar
0 votes
0 answers
109 views

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 ...
phip1611's user avatar
  • 101
2 votes
2 answers
133 views

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 ...
Pablo Repetto's user avatar
0 votes
1 answer
126 views

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 ...
tonymasek's user avatar
2 votes
1 answer
359 views

Considering the following script: if [[ -z "$DOWNLOAD_ONLY" || "$DOWNLOAD_ONLY" = *conditions* ]]; then function get_condition { curl -s "https://conditions.com" | ...
m26a's user avatar
  • 131
0 votes
1 answer
623 views

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 ...
aneeqaf's user avatar
3 votes
0 answers
197 views

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 ...
Binarus's user avatar
  • 3,951
0 votes
0 answers
121 views

I have root access to a Linux system and need to log processes without installing any additional software, using only built-in tools like top. However, I want the process to run in the background ...
Akhil Akkapelli's user avatar
0 votes
2 answers
155 views

According to this answer to How to Hide PID and Exit Status When Running a Background Command in Terminal, using (some command &) one can stop the PID of the background process from appearing in a ...
userrandrand's user avatar
2 votes
0 answers
76 views

I don't understand why wait returns 127 in this case. According to man bash, this happens if the subprocess does not exist anymore. This seems to not be the case. This is the minimal example: #!/usr/...
doak's user avatar
  • 261
4 votes
0 answers
129 views

Consider the following script: rm -f /tmp/bar echo foo >/tmp/bar & tail -f < /tmp/bar When processing the echo line, does the shell first perform the redirect opening /tmp/bar for writing ...
Igor Bukanov's user avatar
0 votes
2 answers
195 views

I have an array, a=(...), and a function, b {}, which takes an argument. I want to build a loop for i in ${a[@]} to traverse the values of a. In the loop, I use commands like (b $i) & to multitask....
Alan Gatsby's user avatar
1 vote
1 answer
1k views

I would like to run the qemu vm that you see below runs between the processes,so I don't want to see any monitor,graphic,terminal window,nothing should be shown on the screen. /usr/local/bin/qemu-...
Marietto's user avatar
  • 599
1 vote
1 answer
104 views

I want to allow the leading program(s) to operate in a standard manner and detach from the terminal once a graphical application launches. In this example fzf reads paths from a file, feeds the ...
user598527's user avatar
0 votes
1 answer
148 views

before I explain my issue I should mention that I'm relatively new to Linux so please forgive my ignorance. I'm using an old Dell E10S to act as a dedicated Minecraft server.  I managed to install ...
Lexus's user avatar
  • 1
0 votes
1 answer
72 views

If I run ./script.sh &, where script is the following: #!/bin/bash echo "hello" sleep 30 echo "hello again" sleep 30 touch /root/foo.txt Then I use ps au, to identify the "...
Thomas Stokes's user avatar
0 votes
1 answer
218 views

I have 1 service registered with systemd open_ssh.script autossh -M 0 -L 8080:127.0.0.1:8080 -i .ssh/id_rsa USER@HOST -fN auto_open_ssh.service [Unit] Description=SSH Tunnel Service After=network....
Hoang Anh Nguyen's user avatar
0 votes
0 answers
52 views

When I run the command in the terminal: sudo badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:8080 I get a terminal with packet data ...
moninah's user avatar
  • 15
14 votes
2 answers
2k views

I want to run two shell scripts after each other, in the background, preferably also using nohup. I start with % nohup a.sh & This runs a in the background. % nohup a.sh && nohup b.sh ...
d-b's user avatar
  • 2,077
1 vote
1 answer
654 views

In a shell script, I am trying to start a background command that has the same stdin as that of the shell script. #!/bin/sh # ... the-program & However, the-program above will not have access to ...
Flux's user avatar
  • 3,318
5 votes
3 answers
1k views

I would like to open a PDF with evince from the command line and after the Evince window pops up, I want to go back to the terminal command with $ already waiting for the next command. Now if I run ...
Fibo Kowalsky's user avatar
1 vote
1 answer
135 views

I was experimenting with ssh, nohup, bg etc. I started a tail process in remote using $ ssh remotehost '{ nohup tail -f ut.log &> /dev/null < /dev/null &} && echo $!' It ...
Sourav Kannantha B's user avatar
2 votes
3 answers
896 views

I'm trying to write a quick-and-dirty shell script daemon to run on a home router that has a busybox shell, which doesn't support disown. Is there any way to do either of the following? Run a command ...
joshlf's user avatar
  • 405
0 votes
0 answers
176 views

I execute a long running Python-process. To stop the annoying noise from the fans I use AppPolice to prevent this process from using more than 20 % CPU (I don't care when it finishes). I think that ...
d-b's user avatar
  • 2,077
0 votes
1 answer
97 views

So as an example if I run: sleep 1 & sleep 2 & sleep 3 I will immediately get the process IDs e.g. [1] ... [2] ... and then the shell freezes until the sleep 3 finishes running and then ...
borna morasai's user avatar
0 votes
1 answer
226 views

I am trying to get a background process to print to the terminal. I haven't seen anything that otherwise indicates there is anything else to do besides stty -tostop. Am I missing something? Running ...
Sterling Butters's user avatar
1 vote
2 answers
877 views

As far as I've seen, pressing Ctrl-Z on any terminal multiplexer, or trying to start them in the background, does nothing or crashes. I know that, in a sense, terminal multiplexers are a "...
Sebastian Carlos's user avatar
0 votes
2 answers
2k views

I want the exact opposite of this question. I want to know how I can create a process that keeps restarting if it's killed. Could someone give me an implementation example? For instance, let's assume ...
locnnil's user avatar
0 votes
0 answers
126 views

The home directory of user bob is mounted by a superuser from elsewhere. bob himself is a sudoer, he is logged in and is happily using his mounted home directory. He finishes his work and wants to run ...
Greendrake's user avatar
29 votes
2 answers
6k views

"Yes, and..." is a wonderful rule-of-thumb in improvisational comedy. Not so much in the UNIX world. When I run the admittedly silly yes& command, I cannot interrupt it. The terminal ...
Sebastian Carlos's user avatar
2 votes
2 answers
4k views

I have a systemd service which spawns an ffmpeg process any time it detects a new event. These processes are meant to survive and run to completion even if the service is restarted (hence them being ...
plunker's user avatar
  • 87
-1 votes
1 answer
241 views

I am using ubuntu Jammy release and on my system port no 3306 is unusable since I tried ssh based port forwarding on the same to a different machine. Also while running ps -aux it shows a strage ...
Gautam's user avatar
  • 121
2 votes
2 answers
713 views

I was checking possibilities of pid leaks about a bash script which continuously create background jobs yet not call wait command, I happened found (by strace) that Bash monitors SIGCHLD and ...
osexp2000's user avatar
  • 632
0 votes
1 answer
633 views

I run a lot of vim windows, and often put them in the bg. The problem is that they all say vim when I list jobs so it's hard to distinguish. [1] - suspended nvim [2] - suspended nvim [3] + ...
pixelearth's user avatar
0 votes
1 answer
453 views

My OS is AIX (7.2) and my shell is ksh88 (preferably) or ksh93, if necessary. I want to write a script that sets some maximum timer for its execution. If it manages to finish its task within this time ...
bakunin's user avatar
  • 793
1 vote
1 answer
135 views

Spec According to this online POSIX Spec, in Shell & Utilities, Shell Command Language, Section 2.9.3 Lists has the following to say about Asynchronous Lists: When an element of an asynchronous ...
D. Ben Knoble's user avatar
0 votes
1 answer
213 views

If I just run sleep 1 & in bash, the sleep process will get reaped almost instantly after it dies. This happens whether job control is enabled or disabled. Is there a way I can make bash hold off ...
Joseph Sible-Reinstate Monica's user avatar
1 vote
2 answers
211 views

If I do: sleep 1 versus sleep 1 & wait $! will there be any difference in terms of CPU usage for spawning a foreground process versus a background process? Or will the performance of both lines ...
Maestro's user avatar
  • 233
0 votes
1 answer
207 views

Currently I do: while [ -d "/proc/$PID" ]; do sleep 1 done To wait for a process to exit. If I would replace it with: tail --pid=$PID -f /dev/null Would that be more efficient for the ...
Maestro's user avatar
  • 233
0 votes
3 answers
127 views

From a bash script, I need to start three processes and put to each of these processes a name, in order to be able to stop them in a later stop command. # Démarrer les applications eco emploi : ...
Marc Le Bihan's user avatar
6 votes
2 answers
2k views

After pausing the process with Ctrl+Z, I attempted to send it to background with the bg command.  Unfortunately, the process isn't sent to the background, and reappear to be running foreground.  Then, ...
Faxopita's user avatar
  • 179
1 vote
0 answers
149 views

I used ssh to start a dotnet app as background job on a remote server dotnet MyApp.dll & I confirmed, that the app was running and then terminated the ssh session. Now I want to kill this ...
AracKnight's user avatar
0 votes
1 answer
101 views

I'm interested in Linux specifically, but an answer for other Unices would be great as well: Does the system have a way of signaling to a process that it's been launched in the background? In other ...
Joseph R.'s user avatar
  • 40.6k

1
2 3 4 5
13