The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
34 views

What is Best Practice for running PHP in background?

When running the following on the command line it will be suspended until I issue the fg command: /usr/bin/php -r 'phpinfo();' & This is the case regardless if the PHP code is contained in a ...
2
votes
1answer
37 views

Right way of running a root task/program at background

I'm writing a program that needs to run at the background as root. (for any user) To do this I used the /etc/rc.local file. And it seems to work. The problem that I am experiencing is, when a ...
1
vote
1answer
27 views

Process id of a command ran by an user

Consider i am running just some basic command.. ls Now would the above command have a pid, when it was getting executed? If yes, then how can i determine that pid? when i try echo $! right ...
1
vote
1answer
31 views

Run a GUI application in background and reconnect later [duplicate]

Is there a way to run a Gui application (X11) in background so that if I disconnect, I can resume the running app again? I am using SmarTTY on windows to connect to remote CentOS. When I run a Gui ...
1
vote
1answer
57 views

How to run “&” operation sequentially

From my script I am running following commands: SCRIPT_1="ksh -x script1.sh & ksh -x script2.sh"; SCRIPT_2="ksh -x script3.sh & ksh -x script4.sh"; eval $SCRIPT_1; sleep 20s; eval ...
0
votes
1answer
23 views

Interactive shell in background inside another shell script

I have some problems when trying to run an interactive sh session inside a shell script. The inner sh process uses all the CPU and never terminates. To reproduce the issue simply create a file named ...
8
votes
1answer
260 views

Echoing progress from a background process without hijacking prompt

Consider the simple script hello: #!/bin/bash echo 'hello world!' Now from bash if I try to run this in the background: $ hello & [1] 12345 $ hello world! █ <--- prompt is stuck here until ...
0
votes
2answers
33 views

Creating background process and communicating with it

1st thing off, I am really a Linux newbie - knowing just some basics; there's a great chance I didn't know what I need to look for, please redirect me if you know a good source. What I'm trying to do ...
4
votes
5answers
267 views

Calling multiple bash scripts and running them in parallel, not in sequence

Suppose that I have three (or more) bash scripts: script1.sh, script2.sh, and script3.sh. I would like to call all three of these scripts and run them in parallel. One way to do this is to just ...
1
vote
2answers
47 views

Store stdout in variable and send command to background

I have a command in a bash script which I want to capture the output of and then send it to the background. How do I get this done? The following doesn't seem to work (it keeps blocking and outputs ...
4
votes
2answers
124 views

Why does my Python background process end when SSH session is terminated?

I have a bash script that starts up a python3 script (let's call it startup.sh), with the key line nohup python3 -u <script> &. When I ssh in directly and call this script, the python ...
-2
votes
1answer
33 views

Using semicolon to separate a background job from the following one? [duplicate]

Can we use semicolon to separate a background job from the following one? $ nohup evince tmp1.pdf &; nohup evince tmp.pdf & bash: syntax error near unexpected token `;'
0
votes
2answers
76 views

how to run rm in background in terminal

I have the following command to delete files in a folder that are 15 days or older: find /var/www/App/app/var/sessions* -mtime +15 -exec rm {} \; what is the best way to speed this up and run it ...
5
votes
4answers
351 views

When I run `./command.sh &` the background task is suspended. How can I keep it running?

This is what I'm running: alexandma@ALEXANDMA-1-MBP ./command.sh & [2] 30374 alexandma@ALEXANDMA-1-MBP [2] + suspended (tty output) ./command.sh I don't want it suspended to start, I want it ...
0
votes
1answer
32 views

Background a process and execute something with one command

Probably it would be easier to do just with a script, but I wonder why can't I do that with one command. What I have tried so far: $ (ls >/dev/null &) && echo $! 3135 $ (ls ...
0
votes
2answers
32 views

How to launch «gdbserver» in background?

I am communicating with a device via a serial port, and for I am launched «gdbserver» (like gdbserver :2345 myapp) it completely blocks the terminal. Neither an ampersand & symbol, nor ^z ...
1
vote
1answer
69 views

Start a background process from a script and manage it when the script ends

I'd like to run and configure a process similarly to a daemon from a script. My shell is zsh emulated under Cygwin and the daemon is SFK, a basic FTP server. For what matters here, the script ...
2
votes
0answers
45 views

SSH fork kills connection

I am using a linux script which has the task of forwarding control of the system to remote support. In this script one of the commands is a ssh port forward command that will forward the port of the ...
1
vote
2answers
65 views

What is/are the advantage(s) of running applications in backgound?

I really don't know what are the advantages of running applications in the background. Something like Application & via command line. Why exactly do we run applications in background and when ...
2
votes
0answers
60 views

Open a program (VLC) and move it to the foreground

On a Mac, specifically, when I use the VLC command line to open a video file, it opens in the background by default. How can I instead move it to the foreground whenever I run the command to open a ...
3
votes
4answers
368 views

How to return a background task to be in the foreground?

Well, the title does not say much, but I would like to know how to stop a running process after appending it with &. For example, I would like to install software foo. Now, assume, foo has many ...
3
votes
2answers
134 views

Interacting with a running interactive console program from a different process

I have a console program with an interactive shell, similar to say, the Python interactive shell. Is there an easy way to start this interactive program A and then use another program B to run A? I ...
0
votes
4answers
195 views

How to get process id of a command

We are running some command in batch mode. We need to do some more tasks once the existing command is done, so we need to wait until this command is done. For example: bsub -q gui -I calibre -drc ...
0
votes
1answer
28 views

Background Process not running?

I ran a C program with an infinite while loop in a terminal and observed one of the CPU cores shot to 100% usage. When I turn it into a background process using Ctrl+z, the CPU usage suddenly dipped ...
2
votes
1answer
73 views

Trying to achieve fake transparency in Urxvt - can only get a black background?

I'm trying to achieve a (fake) transparent gray background in my URxvt (rvxt-unicode) terminal emulator. Doing this using composite transparency works as it should, but I can't get it to work using ...
1
vote
1answer
127 views

Explanation for background tasks on bash

First, I write a simple PHP script <?php while(true) { echo 'hey'.PHP_EOL; sleep(1); } Then I run it like: php test.php & Obviously goes into background, but keeps running and ...
1
vote
1answer
43 views

Can I start a background process with a specific working directory?

Say I have this structure /masterscript /a/script1 /a/b/script2 In masterscript I spawn the other scripts as background processes: "/a/script1" & "/a/b/script2" & The problem is that ...
0
votes
0answers
24 views

How to make the process run after closing the session [duplicate]

I have started a process in Linux without a terminal multiplexer like screen or tmux, without nohup. Now I want to logout from my remote ssh session without interrupting the execution of that process. ...
1
vote
2answers
70 views

Call background process back to stdout

Is it possible to "call" a background process output to be shown in the terminal? Example: cron starts apt-get to update the system and I want to see the output of apt-get
4
votes
0answers
123 views

How do I execute in background / return early?

For reference, I'm using phpseclib to control a remote SSH server using the 'root' account. I have to start/stop a java process which is ran in the background. Stopping works fine with killall java ...
3
votes
1answer
191 views

Adding wallpapers in GNOME Shell

When executing Activities → Settings → Background, you can find three background tabs: [Wallpapers] [Pictures] [Colors] In [Wallpapers] you can find backgrounds under /usr/share/backgrounds/, but ...
3
votes
1answer
42 views

Is there an easy way to background a sudo shell?

A bit more details, what I'm looking for is some kind of ^Z for sudo shells. For instance when running a long command I can hit ^Z to suspend the command or when I do ~^Z in ssh after hitting Enter. ...
8
votes
4answers
873 views

I am using `&`: why isn't the process running in the background?

I know that I can append & to a command to run the process in the background. I'm SSH'ing into an Ubuntu 12.04 box and running a python program with $python program.py & -- but when I go to ...
4
votes
3answers
3k views

Permanent background ssh connection to create reverse tunnel: what is correct way?

Related question: initiate ssh connection from server to client Answer from there helped me a lot, this command does what I need: ssh -R 2225:localhost:22 loginOfServerWithPublicIP@publicIP So I ...
1
vote
1answer
84 views

Can't spawn backgrounded process

My team's using Pallet (think Puppet in Clojure) to automate server provisioning, but running into a fairly fundamental problem: Pallet can execute arbitrary scripts directly on target VMs, but if one ...
1
vote
1answer
78 views

getting pid of two last commands executed in background and do stuff

I wrote this bash: #!/bin/bash eval "(a command) &" pid1=$! eval "(while kill -0 $pid1; do .... ; done) &" #It creates file.txt after few seconds pid2=$! if [ -s ...
3
votes
2answers
93 views

What environment and credential is used by startup, background and service processes

Startup scripts (on boot) Processes running in (or sent to) the background (when using SSH -fN for example) Services etc... What $path variable will they be using? What credentials? Anything else I ...
6
votes
2answers
1k views

what will ¬ do in bash?

While wanting to start gitg as backgrounded through writing gitg & I accidentally typed gitg ¬. This did not cause an error, instead I got with a later command in the same terminal (translated): ...
8
votes
4answers
450 views

Terminate every background process

I have a few Stopped background processes. kill $(jobs -p) and kill `jobs -p` have no effect kill %1, kill %2, etc. successfully terminate individual processes How can I kill every background ...
4
votes
2answers
410 views

Opening a file with program in background from shell

The command to launch a program, say evince, from bash shell in background is evince & But what if I want to open some file with evince in background? Nor evince myfile.pdf & neither evince ...
4
votes
2answers
5k views

Shell script wait for background command

I am writing a script, but there is something I need that I can't find a way to do it... I need to make a command in background "command1 &" and then somewhere in the script I need to wait for it ...
1
vote
1answer
77 views

What does ^Z mean?

I tried using ^Z to send and application to the background(to then use fg to restore) but I notice that it says "Stopped" and in another terminal while monitoring htop, everything just freezes. Is ...
1
vote
3answers
630 views

`wait` doesn't wait for `wget --background`

I have gone through several SE posts on the unix wait command and none of the posts resolve my problem. I have a weather forecast model to run. It has first to prepare some folders, then download data ...
3
votes
3answers
162 views

Log to multiple files while process in background (nohoup)

I have bash script that logs to two log files in parallel. echo "$(date) | [STATE] Activating IP forwarding" >> $logsPath$logFileName echo $(date +"%Y-%m-%d %H:%M")","$previousState >> ...
0
votes
3answers
117 views

My ubuntu background is totally black, even after opening programs such as terminal

My Ubuntu background is totally black when I log in. I can open the terminal, write command so that i open other programs, but I am unable to see any of it.
6
votes
3answers
3k views

reliable return code of background process

Let's assume the following piece of bash code: foo > logfile 2>&1 & foo_pid=$! while ps -p$foo_pid do ping -c 1 localhost done wait $foo_pid if [[ $? == 0 ]] then echo "foo ...
1
vote
1answer
156 views

spawning multiple Background processes

I have a file which has 2,000,000 lines in it. I am running some commands for each line. I was trying to achieve some parallelism using GNU-parallel and swift as discussed here. However, I got an ...
1
vote
2answers
1k views

How do I run two ongoing processes at once in linux/bash?

I would like to know how I can run two ongoing processes at the same time in Linux/bash. basically, I have a Node web server, and a MJPG-Streamer server. I want to run both these processes at once, ...
1
vote
1answer
267 views

Alias for redirecting both standard output and standard error, as well as sending to background [duplicate]

I am trying to create an alias for redirecting both standard output and standard error of gedit to /dev/null, whilst sending the command to background. This works: $ alias gedit='gedit $1 > ...
9
votes
3answers
549 views

If you ^Z from a process, it gets “stopped”. How do you switch back in?

I accidentally "stopped" my telnet process. Now I can neither "switch back" into it, nor can I kill it (it won't respond to kill 92929, where 92929 is the processid.) So, my question is, if you have ...