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.

91 questions
5
votes
2 answers

Shell background processes: what do characters in termination message mean?

I had three background processes, and here's what I've got: [1] Done zcat jan.txt.gz > j [2]- Done zcat feb.txt.gz > f [3]+ Done zcat mar.txt.gz > m What do those " ", "+", "-" mean?…
alamar
  • 69
  • 9
3
votes
1 answer

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 already running the process at the time you want…
sorin
  • 8,016
  • 24
  • 79
  • 103
3
votes
2 answers

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 time); run some instructions; stops the background…
Seiti
  • 145
  • 1
  • 3
  • 10
3
votes
2 answers

Spawning multiple instances of a daemon in Ubuntu

I have a python script that listens and blocks while it waits for data on a redis list. It runs fine in upstart using the following: description "stage message consumer" author "Nilesh Ashra" start on started mountall stop on…
3
votes
5 answers

Is there a simple way to daemon-ify a simple task?

I ssh into a server than start a job (for instance rsync), then I just want to be able to log out from the server and let the job run its course. But if I just do rsync ... & I think it's still connected to the tty in some way, and that the job dies…
Jonas Byström
  • 194
  • 2
  • 12
2
votes
3 answers

Running multiple PHP CLI's in the background gives MySQL errors

We run a meta search engine (price comparison) where each search spawns a number of real-time searches on various websites and presents the merged and sorted search results on our site. We use PHP/MySQL/Apache on a Linux Debian server in a quite…
Martin Larsen
2
votes
4 answers

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 terminates. However, when I switch to bash by…
Dari
  • 121
  • 2
2
votes
2 answers

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 regardless as soon as I close mobaxterm my process on the…
lazarus
  • 121
  • 1
  • 3
2
votes
0 answers

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 commands are this: nice -n19 ionice -c3 nocache Source:…
guettli
  • 3,591
  • 17
  • 72
  • 123
2
votes
1 answer

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 internal_rexec root 25432 23492 0 15:24:32 ? 0:00…
dig_123
  • 285
  • 4
  • 11
2
votes
1 answer

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 that it can pick up where it left off after…
vmrob
  • 123
  • 1
  • 5
2
votes
3 answers

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 cron, but this has delay up to one minute. I'd like…
takeshin
  • 1,471
  • 3
  • 21
  • 28
2
votes
2 answers

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 prolonged periods. I would like to use the idle cpu…
camelccc
  • 255
  • 1
  • 15
2
votes
0 answers

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 unrelated command the process receives a…
2
votes
5 answers

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 file, such as the below: php /path/to/script >…
DOOManiac
  • 791
  • 6
  • 12
  • 26