Cannot run a script/command at boot and send it to background
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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
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] &
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.