Nohup not give expected output. Non-stop running process


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Nohup not give expected output. Non-stop running process
# 1  
Old 10-11-2016
Nohup not give expected output. Non-stop running process

Hello,
I am trying to make a bash script, I tested nohup but it did not help me.
My code is:

Code:
ffmpeg -i $input_url -c:v copy -c:a copy -listen 1 -f mpegts http://localhost:port/live/test

When I open it in VLC, it starts feeding my screen and I see bitrate values.
When I stop watching it, script ends but it does not go back to sleep mode.
To open it in VLC again, I need to run that command from terminal.
What I wish to accomplish is when the script ends, it should re-runs itself after killing reserved PID nr.

1.st attempt
Code:
nohup & ffmpeg -i $input -listen 1 -c:v copy -c:a copy -f mpegts http://localhost:port/live/test

2.nd attempt
Code:
nohup ffmpeg -i $input -listen 1 -c:v copy -c:a copy -f mpegts http://localhost:port/live/test &

Could you please let me know with which command I can make it running?

Thanks in advance
Boris
# 2  
Old 10-11-2016
Not sure I entirely understand, but why don't you run the command in a loop and drop the nohup and & ?
This User Gave Thanks to RudiC For This Post:
# 3  
Old 10-11-2016
Hello Rudic,
Do you mean something like this:

Code:
while true; do
    $ffmpeg_command
    sleep 5
done

PS: I wish that script be ready to run even if I watch it or not. For that reason I wish to make it vivid permanently.

Thanks in advance
Boris
# 4  
Old 10-11-2016
Can't tell; test it and find out if it suits your needs...
# 5  
Old 10-11-2016
Works very nice
Thanks once again Rudic!!

Kind regards
Boris
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

PS output is not displaying full process running

I have 4 HPUX 11.31 servers with the same Quality Pack bundles. "AS FAR AS I CAN TELL" no system files have been modified. /usr/bin/ps is the same date size and creation date terminfo file (x-->xterm) is the same date size and creation date shell (ksh) is the same date size and creation date ... (4 Replies)
Discussion started by: mrmurdock
4 Replies

2. UNIX for Advanced & Expert Users

Running process in nohup

Hi All, I am facing issue in running a process in nohup. I ran a process in terminal since it is taking too long to complete I need to make it as background and nohup. I tried below and was able to make it in back ground 1. Cntrl + Z 2. bg I am using Korn Shell so disown is not working... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

3. Shell Programming and Scripting

How to pause process running under nohup?

Hi ALL, Is there any way to pause a running process under nohup ? I have fired a build commands with required flags under nohup as below. now how can I pause the started build process. nohup make DEVICE=ap DEBUG=1 & I understand we can use ctrl + z to pause a foreground process... (3 Replies)
Discussion started by: useless79
3 Replies

4. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

5. UNIX for Dummies Questions & Answers

How do I send output of a background process to a file other than nohup.out?

I have a question. I will be running a background process using nohup and & command at end. I want to send output to a file say myprocess.out. So will this command work? nohup myprocess.ksh > myprocess.out & Thanks in advance guys !!! :) (3 Replies)
Discussion started by: vx04
3 Replies

6. UNIX for Dummies Questions & Answers

Nohup not working as expected

Hi. I am trying to start a script on my router that will execute even if i log off. To execute the script I write: nohup ./dslconnection > dslstat.out 2>&1 & It starts the job: 21968 admin 1604 S /bin/ash ./dslconnection The problem is that when I log back in the job has been... (6 Replies)
Discussion started by: sebcou
6 Replies

7. Shell Programming and Scripting

How to stop nohup which is working background

Please I have run a background script using nohup please tell me way to stop this. Thanks in Advance (4 Replies)
Discussion started by: mumakhij
4 Replies

8. Shell Programming and Scripting

Process running? Stop it

I have this "process keepalive" script: #!/bin/bash PIDFILE=/tmp/php.pid PHPSCRIPT=/home/www/mydomain.com/subdomains/www/parser.php echo 'Checking php process from PID file' if ; then PID=`cat $PIDFILE` if ps ax | grep -v grep | grep $PID > /dev/null then echo "php process still... (4 Replies)
Discussion started by: LukasB
4 Replies

9. Shell Programming and Scripting

how to stop the process that is running continously

Hi there, I have written a script to check daily process, each script is in a different directory. Now the first process is running fine, when it goes to the next directory the process doesn't executes. cd result/logs ref=month_1888.log echo $ref>> $logfile cd /max/tot/first... (3 Replies)
Discussion started by: NehaKrish
3 Replies

10. Shell Programming and Scripting

Usage of NOHUP - How to keep the child process running even if I close the Server connection

Hi. ! When I use the 'NOHUP' along with the '&', the process will be running in the background. Even when I attempt to close (Meaning 'EXIT') the session (say PUTTY in this case), it wont exit unless the process is completed. But, say when I forcefully terminate the session (SHUT DOWN the... (2 Replies)
Discussion started by: WinBarani
2 Replies
Login or Register to Ask a Question