LinuxQuestions.org
Review your favorite Linux distribution.
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 11-02-2010, 08:20 PM   #1
connie84911
LQ Newbie
 
Registered: Jan 2010
Posts: 24

Rep: Reputation: 0
ubuntu rc.local


Hello,

I'm having a problem getting a program to run from /etc/init.d/rc.local. I can run my script manually once the system has booted. Here's what I've tried the following without success:

1) creating the script in /etc/init.d and using update-rc.d to create symbolic links to use at boot time
2) add the script name in /etc/rc.local
3) add the script name in /etc/init.d/rc.local

I've run these scripts with "- x" to get verbose output and my app seems to get called, however when I do a "ps waux" it's not there. If I understand correctly, the *right* way to do this is 1 above.

If this is not the right forum - please let me know.

Thanks!
 
Old 11-02-2010, 09:00 PM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 291Reputation: 291Reputation: 291
Some quick googling has found that you may need to run update-rc.d to get the startup scipt to run. See:
https://help.ubuntu.com/community/RcLocalHowto
http://www.debian-administration.org/articles/28
Hope this helps.
 
Old 11-02-2010, 09:55 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by connie84911
I've run these scripts with "- x" to get verbose output and my app seems to get called
I don't understand how there's any uncertainty about whether the script/app is getting called. You need to answer that first. Modify the script to perform some kind of task that you can verify. For example, add this as the first command the script executes:
Code:
echo "$( /bin/date ) - Script started" >> /var/log/myscript_log.txt
Then, after booting, check that the file exists and that the timestamp is what you would expect. There should be no "seems to get called" after you do this.

If the /var/log/myscript_log.txt file does not exist, your script is not getting called. If it does exist, there's a problem with your script.

99% of the time, when a script works by manually starting it, but fails when automated, the problem is because of the environment variables--specifically PATH. I suggest you use absolute paths to ALL of your commands inside your script. If you want to understand the reason behind the environment variable difference, then open a terminal and read the bash man page: interactive and non-interactive shells. The startup process is different depending on which is invoked.
 
  


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
local man pages in ubuntu avee137 Linux - Newbie 1 04-15-2010 07:41 AM
Local ubuntu DVD repository dipuasks Ubuntu 1 12-15-2009 04:51 AM
Adding music from local library in ubuntu feelin_froggy8877 Linux - General 2 10-11-2009 11:29 AM
Creating Ubuntu Local Repository? your_shadow03 Linux - Server 1 03-18-2009 04:59 PM
Setting Up Local Ubuntu Repositories AntWarrior Ubuntu 2 04-22-2005 07:49 AM

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

All times are GMT -5. The time now is 08:17 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