LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 01: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, 02:45 PM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 934

Rep: Reputation: 104Reputation: 104
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, 03: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, 04:00 PM   #4
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 934

Rep: Reputation: 104Reputation: 104
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:21 PM
bash script in background - awk and send email noir911 Programming 4 03-22-2009 10:46 PM
is there a system call to send process to run in the background? feetyouwell Programming 4 10-01-2004 05:58 AM
run command in background using C syberdave Programming 3 04-03-2004 07:43 AM
How to run a bash command in the background from perl script professorfrink Programming 3 11-13-2003 04:02 PM


All times are GMT -5. The time now is 06:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration