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 ...
3 votes
2 answers
26k views

cmd.exe: how to start a background process, run some things, stop background process

I want to run a batch script that: starts a background process (a Selenium RC server, if that matters); waits until the background process starts to listening some port (or wait a fixed amount of ...
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 ...
61 votes
6 answers
87k views

How can I run mongod in the background on unix (mac osx)?

I would like to run mongod in the background as an always present sort of thing. What would be the best way to do this? Kind of like the way I can run MySQL on startup and it's just always there ...
0 votes
0 answers
29 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 ...
0 votes
1 answer
615 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/...
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 ...
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 ...
33 votes
4 answers
55k views

Writing to stdin of background process

I'm on an Ubuntu 10.04 box, and started a server in the background (myserver &) over ssh. It's been running fine, but I need a way to get at the server's stdin, as the only way to control the ...
5 votes
2 answers
3k views

Dynamic number of supervisord controlled processes

I am using supervisord's [program:x] to keep my background queue runners up and running. The amount of numprocs is set to a static number, but now I am looking for a solution to dynamically adjust the ...
0 votes
1 answer
232 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, ...
1 vote
1 answer
252 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....
24 votes
3 answers
25k views

How do I start a process in suspended state under Linux?

Practically, I need a process which behaves, as if I had pressed Ctrl+Z just after it started. Hopefully, it is possible to do such thing using a shell script. (Also, knowing the resulting PID would ...
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 ...
0 votes
0 answers
264 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 ...
2 votes
3 answers
5k views

Process running in background got killed in linux

I am having a remote server to which i connect using ssh. I started a process(mongodb) on the server using following command- "/usr/bin/mongod --dbpath /mnt/ebs-300/mongodb --logpath /mnt/ebs-300/log/...
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....
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
0 votes
5 answers
1k views

"Silent" Backgrounding a Process

I have added a git pull & to my bashrc to keep a particular project always up to date! However this means every time I open a terminal I get a message like [17]+ Running git pull And a few ...
7 votes
2 answers
8k views

Start Sinatra app in the background with stdout and stderr redirected (append) to a file

I have a Sinatra app which I run on my local machine using ruby app.rb. While deploying it on a remote machine via ssh, how do I run it in background and redirect stdout and stderr to a log file? On ...
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 ...
-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 [...
2 votes
4 answers
884 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 ...
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 ...
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 ...
5 votes
6 answers
6k views

Running Subversion post-commit hook as a background process

Because currently our Subversion post-commit hooks take way too long to execute I've been trying to speed things up. I've been thinking about executing the actual hooks as a background process, so ...
1 vote
1 answer
3k views

Run a PHP script as a background process on a WAMP server

I have two PHP scripts that need to be run as continuous background processes on a WAMP server. WAMP is installed on a Windows 7 PC. These scripts are already reside in separate folder in the www ...
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 ...
-2 votes
1 answer
176 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 ...
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 ...
0 votes
1 answer
334 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 ...
-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 ...
0 votes
0 answers
106 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 ...
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 ...
-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 ...
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 (...
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 ...
6 votes
5 answers
32k views

Tools to run a background process command line in windows?

In linux we just need to append a & and that's all. What for windows?
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...