LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-14-2012, 12:54 PM   #1
sarcasm_Inc
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Rep: Reputation: Disabled
Question Cannot run a script/command at boot and send it to background


Hello all!

I seem to be having some problems with getting a script to run a command and send it to background at system boot.

I have a Debian system(without X) and a simple script(added via rc.d-update with default settings) that executes a command(starts a program that has to keep running), but after the script executes the command, it locks the terminal and it does not proceed to login prompt.

The goal is to have the program start in background. So when it starts at boot, it's sent to background and login prompt is shown.

I've tried adding ampersand at the end of the command in the script, but that just does nothing.

I will be very, very thankful about any help I can get.
Cheers!
 
Old 10-14-2012, 01:45 PM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Hi
The first question is probably if it's your program or if it's your rc-script causing the problem.
Try therefore to comment out in your rc-script the line that starts your program and see if your system boots normally.

If it does not then review the rc-script itself.
If it does... well, if you put the ampersand at the end it's supposed to push it to the background - would be weird if that does not work => in this case you would probably have to post your script here.
Cheers
 
Old 10-14-2012, 02:44 PM   #3
sarcasm_Inc
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hey, thanks for the reply!

It's not the rc-script itself.
The program in question is SoX, the script launches a SoX recording session. If I set recording time to, say, one minute, after the minute has passed, SoX closes itself and login prompt is displayed. In other words, until SoX finishes, it does not proceed to login prompt. Adding & to the end of the line that starts SoX in the script doesn't do anything... unless I'm missing something.

Basically, what I have in the script is this: rec [options] outputfilename [some more options] [recording time] &
 
Old 10-14-2012, 03:00 PM   #4
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Oh, ok - sox is probably a quite "central" program - it might be that it does not allow more than 1 copy to run concurrently.
Have to surrender - sorry.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run script in background MikeQ Linux - Newbie 2 09-11-2009 06:21 PM
bash script in background - awk and send email noir911 Programming 4 03-22-2009 09:46 PM
is there a system call to send process to run in the background? feetyouwell Programming 4 10-01-2004 04:58 AM
run command in background using C syberdave Programming 3 04-03-2004 06:43 AM
How to run a bash command in the background from perl script professorfrink Programming 3 11-13-2003 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration