Questions tagged [background-process]

On POSIX systems a background-process is created in a shell by either adding an ampersand symbol after a command (e.g. ./script.sh &) or by pressing CTRL+Z while the command is being executed. The command will then run independently from the shell but will still write stdout and stderr output to the shell from where it has been started. It can only be stopped with the kill command.

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

time nohup ./script --> the time hasn't been logged [closed]

I need to measure the time that Firefox takes to build itself from the source code. Here's what I do normaly: nohup ./mach build > my_log.log & I then prepended time to it: time nohup ./mach ...
Kentuk's user avatar
  • 1
0 votes
0 answers
21 views

Can I run Cloud Automation (azure/aws) for web apps in background doing other manual work parallel?

my goal is to automate some tests for a web app and in parallel do some other staff manually (like writing code locally or research or writing reports) and don't collide with it. I used softwares like ...
Antwnina's user avatar
0 votes
0 answers
30 views

ssh connection reuse breaks -f (background launch), why?

When not using connection sharing the following will return immediately after launching a remote sleep process: $ ssh -f host "nohup sleep 10" However if I specify that I want to use ...
samwise's user avatar
0 votes
1 answer
616 views

Proper way to put http-server into background

I'm using raspbian on a pi Zero to serve a simple static HTML page with an index.js and some styling. I'm using the npm package http-server I've installed it globally. https://www.npmjs.com/package/...
user2402616's user avatar
1 vote
1 answer
5k views

Application Pool set to AlwaysRunning does not Auto Start The Hosted Service

I have configured an pool to auto-start and never sleep. I am having problems with the auto-start. My understanding is that a thread pool worker will be started after a recycle when that happens I ...
Ross Bush's user avatar
  • 121
0 votes
1 answer
233 views

command that cannot work in background (asterisk)

am trying to run script in background which contain command such like "asterisk -rvd >> xyz.log", when I run it directly it work well but when run it with any background way (service, ...
Centos's user avatar
  • 11
1 vote
1 answer
254 views

systemd kills my ngrok session started from python

I have a script i wrote that listens on mqtt. When certain code arrives to the mqtt server then an ngrok session is started like so: subprocess.Popen(['/tmp/ngrok','http' ,'8080'], stdout=subprocess....
codeScriber's user avatar
0 votes
0 answers
266 views

What could cause processes to not be active

Running linux and executing a bunch of PHP scripts. I noticed that our CPU usage was pretty low but many processes were sleeping, so started investigating. AWS EC2 with an S3 bucket. I can't seem to ...
D.Mill's user avatar
  • 379
0 votes
1 answer
1k views

How to terminate real time logging after it has been initiated with journalctl -f &

Environment: CentOS 8 I turned on real time logging with the command, $ journalctl -f & I got the information I needed but unfortunately I'm not sure how to stop it. [CTRL] -c does not stop it....
myNewAccount's user avatar
1 vote
1 answer
2k views

too many ssh-agent process per user on several servers [closed]

Several users seem to have problems with the usage of ssh-agent in their login environment. sri for instance has 1295 of them running on login02. And many other users are having same issue. I am ...
gokam's user avatar
  • 13
0 votes
1 answer
110 views

logger and tee running in background?

Sometimes I notice the server is running slowly and at those times a ps -e shows that logger and tee are running but I can't think of why. Is this a known issue? Why would these need to run without ...
stone.212's user avatar
  • 347
0 votes
2 answers
382 views

re-parenting to screen two processes joined by pipe [duplicate]

Let's say in a PuTTY connection I start mysqldump --host host1 --databases db1 db2 db3 | mysql which creates two processes: mysqldump with PID 5800 and mysql with PID 5801. Is it possible to let the ...
user avatar
1 vote
1 answer
1k views

Windows Service: specifying a custom stop command

We have a custom application that messes with a LOT of 3rd party resources. When terminating, we need to gracefully "give up the lease" so to speak. The app itself is written in .NET Core (and ...
Paul S.'s user avatar
  • 13
0 votes
4 answers
1k views

CPU bumps to 100% in a PHP web application: How do find out what started it?

I have a Debian server (Amazon AWS) with a PHP web application that is used by hundreds of users. My CPU usage is almost always below 10%. Today around 12:00AM~ I had 2 insane jumps to 100% for ...
Rick Sanchez's user avatar
-2 votes
1 answer
27 views

What `+` and `-` means in background jobs output [closed]

When I run a bunch of background jobs with for s in {1,2,3}; do command_$s &; done; I can see all of them with the jobs command $ jobs [2] running command_1 [3] - running command_2 [...
Greg's user avatar
  • 149
2 votes
4 answers
885 views

Running an application in background

I have a web app on a freebsd server. An app is a single executable file, with a built-in webserver. My default shell is zsh. When I'm running it as "./my_website &" and close a connection, it ...
Dari's user avatar
  • 121
0 votes
3 answers
290 views

Edit a command send to background

Is it possible to edit the command line of a process sent to background, or to chain another command to execute after the first command has exited? Eg: I start mirroring a site with wget -m site.com ...
Joel G Mathew's user avatar
2 votes
2 answers
5k views

keeping a detached ssh process running *after closing the ssh client*

I ssh in to my ubuntu machine usimg mobaxterm. This works very well. Sometimes I want to keep a process running but exit my ssh session (and exit mobaxterm). I have tried the following but ...
lazarus's user avatar
  • 121
1 vote
1 answer
477 views

how to run 10 process and montring it

i have about 10-15 FFmpeg Process for streaming server like this: ffmpeg -i "http://ip/play/a03i" -vcodec copy -acodec copy -f flv "rtmp://ip:80/APP/Name" am use the Nginx-rtmp module to run it ...
Mohammed's user avatar
13 votes
2 answers
47k views

How to schedule a task to call a URL

I have an MVC app. I have a controller that when called runs a background process to query Active Directory and updates the database. http://myapp/BackgroundTask/Run I want to run this on a ...
Jack's user avatar
  • 527
1 vote
0 answers
137 views

PHP daemon shows status of "stopped" - can't run php script in the background

I'm trying to launch a PHP script in the background (Linux/Centos 6.8) by appending the & symbol to the command. However, 'jobs' lists the script with status [1]+ Stopped. Issuing a 'bg 1' to run ...
Ryan Griggs's user avatar
  • 1,013
-2 votes
1 answer
177 views

How to resume then send a program back to the background

I know I can run something in the background by adding & to it, such as tail -f log.log I can then resume or send the job to the foregrond with fg However, once I do this, how do I send it to ...
Startec's user avatar
  • 107
0 votes
1 answer
6k views

How do I run a program as another user properly with "nohup" and "&" in bash

I have been learning bash and linux administration over the past few months while producing more and more code that needs to run in the background. I would ideally like to run my development system ...
Kaloyan Pashov's user avatar
0 votes
1 answer
336 views

Understanding how to foreground a background process correctly [duplicate]

I am wanting to background a long running script, which I know I can do using the following: nohup ./install.sh &>/dev/null & However, I also realize that if I leave that session, I can ...
Zed Said's user avatar
  • 727
-2 votes
1 answer
51 views

Is there any way to execute any command just after a new connection on apache2? [closed]

I am not too good in server and Linux commands as I am php guy, but I need something which can trigger a command or a script just after a client is connected/disconnected with my web server. The ...
Vikas Chaudhary's user avatar
0 votes
0 answers
107 views

Windows: add user group to file created by a specific process

In our (mixed) Windows network we have a machine with a shared folder. This shared folder can be accessed by anyone belonging to the group User. However, in this folder, there are files that are ...
fritzmg's user avatar
  • 101
2 votes
0 answers
380 views

rsync: Maximum nice to keep system responsive

Unfortunately a background rsync reduces the responsiveness of a server. I search a way to have maximum niceness for this background task, to keep the server respond fast. My current wrapper ...
guettli's user avatar
  • 3,843
5 votes
3 answers
12k views

How to use nohup to continue to run a command after the user logout?

nohup <command> <arg> & When I SSH into a Linux server, if I want to run a command and make sure that it will continue to run in the background after I logout from SSH, I will use the ...
userpal's user avatar
  • 613
-1 votes
3 answers
2k views

Is there a way to know what services run on a Windows server without logging in to this server?

Hi I just started working as an intern and they use Windows servers for very specific tasks (converting .docx files) that are way harder on their other servers. But now I had to make that program run ...
Thomas's user avatar
  • 113
0 votes
1 answer
505 views

Typing in terminal interferes with `nc` running in background?

I can run these two commands: nc -l localhost 8888 -v >> output.txt & (while true;do sleep 1;echo a;done)|nc localhost 8888 & All works as expected with output.txt filling with "a"s (...
AJP's user avatar
  • 155
2 votes
1 answer
611 views

Lot of duplicate sshd daemons getting created in Solaris

I have a Solaris server where I found lot of sshd services running: ps -ef | grep 23492 root 25449 23492 0 15:27:17 ? 0:00 /usr/sbin/sshd2 -oPidFile=/var/run/sshd2_22.pid -R ...
dig_123's user avatar
  • 295
1 vote
1 answer
4k views

Kill process and child processes, not parent processes, not group

I need to kill a process and all of its subprocesses programatically. Killing the group is not an option because I do not want to kill the parent processes. Example: pid process 1 ...
firelynx's user avatar
  • 119
2 votes
1 answer
5k views

How can I invoke a foreground process from a background PowerShell Job?

I'm working on a PowerShell script that provides console output and restarts the system several times during the script's operation. As soon as it starts, it registers itself as a Scheduled Job so ...
vmrob's user avatar
  • 123
0 votes
1 answer
1k views

How to run Azure cmdlets in background?

Several Azure PowerShell cmdlets have very tedious run times; a trivial task such as setting a static IP address on a virtual machine can take more than a minute (I guess this is because the cmdlet is ...
Massimo's user avatar
  • 71.3k
2 votes
3 answers
7k views

Monitoring file for changes and immediately take action on change

How can I constantly monitor (small) file for changes? Eg. when file is updated (action from web application), a script is executed (if not already running). Right now, I do it every minute using ...
takeshin's user avatar
  • 1,481
0 votes
2 answers
194 views

Identify where and how background process are started and where they comes from

First the short story: I need to migrate a server (applications, configurations and so on) and I have no clue about what is in there, no docs, people at charge just abandon and didn't leave any ...
ReynierPM's user avatar
  • 720
0 votes
2 answers
1k views

Ubuntu server terminating background process when last ssh closed

I have an Ubuntu 14.04 server and I am trying to start Apache Karaf from a ssh, exit the ssh and expect Karaf to remain execting. What I actually find is that as soon as the last ssh is closed/logged ...
D-Dᴙum's user avatar
  • 153
0 votes
0 answers
2k views

Displaying the window of a background process started by task scheduler in the current login?

Is it possible to bring a window that has been started by the task manager in the background to the foreground of an RDP session provided that the same account started the task? And if so how?
leeand00's user avatar
  • 4,919
2 votes
2 answers
298 views

getting an application to run with the same priority as cpu idle

I have a solaris server that needs to run a timecritical application as fast as possible, although setting it to the RT priority class doesnt seem like a good idea since it may need 100 CPU for ...
camelccc's user avatar
  • 255
2 votes
0 answers
913 views

Bash and background processes PGID and receiving signals

My actual problem is that a process I run in an rcfile in docker as docker run container bash --rcfile rcfile remains attached to the bash session by sharing the PGID which means that when I Ctrl-C an ...
Arkaitz Jimenez's user avatar
7 votes
1 answer
2k views

Job Control/background process (using ampersand) in .ebextensions config commands

Take for example the following .config file in .ebextensions/ container_commands: 000_run_queue_daemon: command: "nohup php artisan queue:work --daemon &" test: "ps -ef | grep artisan ...
Ben Swinburne's user avatar
0 votes
1 answer
2k views

Background job terminates when run from script, but works fine when run from bash prompt

I'm on MacOS 10.9.4. I want to put sftp to background to automatically push some files to it through named pipe later, as suggested here. It works fine when I enter commands manually from bash prompt (...
Grigory Glushko's user avatar
1 vote
2 answers
20k views

Fork a process inside a bash shell script

I've a simple shell script like #!/bin/bash sh -c "sleep 60" & exec sleep 120 In using the pstree command, I found something like `-sleep(11681)---sleep(11682) The first sleep is due to the ...
Ryan's user avatar
  • 6,041
-1 votes
1 answer
578 views

Multiple Background Processes at Single Line Works in The Foreground

I want to convert an uploaded PDF file to JPG images and zip these images after convert process finishes. I use the ImageMagick library's convert command for PDF to JPG conversion. To accomplish ...
kubilay's user avatar
  • 159
1 vote
1 answer
590 views

Reliably running background operations

I'm looking for a recommendation on how to reliably run background operations. I have many servers posting operation messages to AWS SQS, and I have another server which will run these CPU intensive ...
Errol Fitzgerald's user avatar
0 votes
1 answer
2k views

How can I find a specific PHP process with pgrep (monit related)

I've got a number of php processes that I'm running in the background, with monit as the manager for them. My current config for monit looks like: check process myprocess1 matching "process1....
Jim Miller's user avatar
2 votes
5 answers
1k views

Amazon Linux: Can't log background task output?

We recently moved to AWS EC2 instances w/ the Amazon Linux distro. On our old servers (RH Enterprise), we've been able to run a command in the background (&) and also redirect the output to a log ...
DOOManiac's user avatar
  • 811
0 votes
2 answers
4k views

How to kill the process using the name of the program instead of PID?

I started my Python program in the background using nohup as mentioned below - nohup zook.py & Now I am trying to kill this process so I did the ps command as mentioned below root@phxdbx1145:/...
arsenal's user avatar
  • 217
2 votes
1 answer
674 views

How often does a Linux check it's /etc/localtime file

I am trying to troubleshoot a problem. Some very helpful information would lead me to a solution is: Often does Linux check the /etc/localtime file? Additionally if there is a configuration file to ...
DarkSheep's user avatar
  • 1,046
6 votes
1 answer
4k views

nohup vs screen vs ? for manually starting daemon processes

When I need to start a background process on a low-importance server, I tend to use nohup: nohup ./server.sh & Most colleagues seem to prefer screen: screen -D -R mydaemon ./mydaemon.sh ^A ^D ...
Steve Bennett's user avatar