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
1 vote
1 answer
267 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 ...
user avatar
  • 121
0 votes
1 answer
148 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, ...
user avatar
  • 1
1 vote
1 answer
92 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....
user avatar
0 votes
0 answers
126 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 ...
user avatar
  • 379
0 votes
1 answer
364 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....
user avatar
1 vote
1 answer
886 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 ...
user avatar
  • 13
0 votes
1 answer
59 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 ...
user avatar
  • 237
0 votes
2 answers
166 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
646 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 ...
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 ...
user avatar
-2 votes
1 answer
23 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 [...
user avatar
  • 149
2 votes
4 answers
515 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 ...
user avatar
  • 121
0 votes
3 answers
198 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 ...
user avatar
2 votes
2 answers
3k 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 ...
user avatar
  • 121
1 vote
1 answer
432 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 ...
user avatar
11 votes
2 answers
37k 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 ...
user avatar
  • 487
1 vote
0 answers
102 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 ...
user avatar
-2 votes
1 answer
116 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 ...
user avatar
  • 107
0 votes
1 answer
5k 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 ...
user avatar
0 votes
1 answer
245 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 ...
user avatar
  • 707
-2 votes
1 answer
35 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 ...
user avatar
0 votes
0 answers
73 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 ...
user avatar
  • 101
2 votes
0 answers
246 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 ...
user avatar
  • 2,984
4 votes
3 answers
9k 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 ...
user avatar
  • 593
-1 votes
3 answers
1k 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 ...
user avatar
  • 113
0 votes
1 answer
379 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 (...
user avatar
  • 143
2 votes
1 answer
541 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 ...
user avatar
  • 255
1 vote
1 answer
3k 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 ...
user avatar
  • 119
2 votes
1 answer
4k 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 ...
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 ...
user avatar
  • 68.3k
2 votes
3 answers
5k 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 ...
user avatar
  • 1,431
0 votes
2 answers
159 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 ...
user avatar
  • 690
0 votes
2 answers
903 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 ...
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?
user avatar
  • 4,777
2 votes
2 answers
271 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 ...
user avatar
  • 255
2 votes
0 answers
793 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 ...
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 ...
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 (...
user avatar
1 vote
2 answers
19k 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 ...
user avatar
  • 5,351
-1 votes
1 answer
555 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 ...
user avatar
  • 159
1 vote
1 answer
544 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 ...
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....
user avatar
2 votes
5 answers
837 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 ...
user avatar
  • 781
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:/...
user avatar
  • 217
2 votes
1 answer
591 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 ...
user avatar
  • 996
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 ...
user avatar
2 votes
1 answer
301 views

Rogue process tracking

I have a debian stable server and I am trying to find a process which wake-up every hour at exactly xh22 (1h22, 2h22, 3h22, etc...) and write something to the disk. However I cannot find the process, ...
user avatar
3 votes
1 answer
3k views

Move a running process in background and keep it running even if you disconnect

You already have a running process and you want to put it to run in background. If you want to be sure that this will still run after you close you ssh connection, what should you do? Note: you are ...
user avatar
  • 7,508
0 votes
1 answer
218 views

In AWS Ubuntu, python process stopped itself when running in background with &

command to start python process: python /root/serverFiles/Cusp.py 8001 >> /root/log/cusp.log 2>&1 & Cusp.py is a python code to call a bio-sequence process tool and return result. ...
user avatar
2 votes
1 answer
513 views

Send input to background process [closed]

I have a process that i run with this command: java -jar loginserver.jar & I need to be able to send commands to this program. I've tried bg/fg but apparently it doesn't persist thru sessions. ...
user avatar
  • 265