background-process

How to detach a piped command from the terminal?

How to detach a piped command from the terminal? 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 selected files and folders to the mpv media player: fzf < paths.txt …

Total answers: 1

How to pass the standard input of a shell script to a background command

How to pass the standard input of a shell script to a background command 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 the same standard input as …

Total answers: 1

Background services on startup

Background services on startup My question is ideological, I want my system to be lightweight but over time I accumulate services that I need from time to time but not always. I was reading this. Why would services like postgres, docker, apache run on every boot? Would make sense for server distros but not for …

Total answers: 1

Manage the dotnet process; detach, reattach and view output

Manage the dotnet process; detach, reattach and view output On my Ubuntu Server I run the command dotnet myapplication.dll to start an application. It subsequently displays a steady stream of output logging to the screen. I would like to be able to perform this action, disconnect from the process, perform some other tasks, and then …

Total answers: 1

How to write a process that restart again every time that it's killed

How to write a process that restart again every time that it's killed 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 that I have a simple process that …

Total answers: 2

Why does "yes&" crash my Bash session?

Why does "yes&" crash my Bash session? "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 crashes or gets stuck into a loop. I expect the yes process to be suspended immediately, since any …

Total answers: 2

Strange mysqld process on my system wont let port 3306 be free

Strange mysqld process on my system wont let port 3306 be free 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 process for mysqld with pid …

Total answers: 1

Bash wait command actually gets result from background job cache, would the cache cause memory leak when it creates background jobs continuously?

Bash wait command actually gets result from background job cache, would the cache cause memory leak when it creates background jobs continuously? 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 automatically calls …

Total answers: 2

Is there a performance penalty for backgrounding a process?

Is there a performance penalty for backgrounding a process? 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 be exactly equal? Asked By: Maestro || Source With …

Total answers: 2

Running grep via GNU parallel

Running grep via GNU parallel How can I make searches with grep on a large number of files run faster? My first attempt uses parallel (which could be improved or other approaches suggested). The first grep simply gives the list of files, which are then passed to parallel, which runs grep again to output matches. …

Total answers: 2

Gnome-Software running in background and consuming RAM

Gnome-Software running in background and consuming RAM Why does this newfangled Gnome-Software have to consume 300mb of my precious RAM in the background? I remember when an previous computer of mine only had 300mb of RAM total, and now this one program is using that much on its own in the background, what can I …

Total answers: 1

Mystery connections at login – how to find out what's responsible?

Mystery connections at login – how to find out what's responsible? I have two connections that occur every single time I login (GUI KDE). They disappear after about one minute. I want to know what they’re telling who. So to get started, how do you take connections found by ss -rt: ESTAB 0 0 DESKTOP:45746 …

Total answers: 1

What is the "kaluad" process on Linux?

What is the "kaluad" process on Linux? I have been browsing running processes on my PC, and I found a process with a name "kaluad", at the time with PID 196 running under root with priority -20. I can’t find it in any documentation, man page for this or any similar name does not exist, …

Total answers: 1

What exactly does it mean to run a process in the "background"?

What exactly does it mean to run a process in the "background"? I want to understand a little bit better, what a background process is. The question came to live as a result of reading this line of code: /usr/sbin/rsyslogd -niNONE & Source The documentations says: -i pid file Specify an alternative pid file instead …

Total answers: 1

How do I kill all subprocesses spawned by my bash script?

How do I kill all subprocesses spawned by my bash script? I have a script that looks like this. Invoked with ./myscript.sh start #!/bin/bash if [[ "$1" == "start" ]]; then echo "Dev start script process ID: $$" cd /my/path1 yarn dev &> /my/path/logs/log1.log & echo "started process1 in background" echo "Process ID: $!" echo …

Total answers: 1

How to send heredoc command to background?

How to send heredoc command to background? I want to send a heredoc command like this one cat <<EOF line 1 line 2 EOF to background. (The actual command is openssl with many lines of input which takes some time to complete). The command needs to be storable in string so that I could exec …

Total answers: 1

Echoing to $(tty) in a backgrounded process

Echoing to $(tty) in a backgrounded process Why does this not print anything? bash -c ‘(while echo "not printing" ; do sleep 1; done) > "$(tty)" & sleep 10’ Even though this, for example, does: bash -c ‘(while echo "is printing" ; do sleep 1; done) > "$(tty)" && true’ Asked By: Max || Source …

Total answers: 1

Vim goes to background when rearranging window layout

Vim goes to background when rearranging window layout The GIF below shows what I’m observing. If I do the following I send Vim to background with Ctrl-Z only once, come back to it via fgEnter, then open another terminal, causing the original one to resize upon performing step 3, Vim is sent to background automatically. …

Total answers: 1