Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
07-14-2003, 05:17 PM
|
#1
|
Member
Registered: Jul 2003
Posts: 33
Rep:
|
Boot Script
hello i have a script i want to start when the server boots. i put the script on the /etc/rc.d/rc.local is this the right place? for some reason it doesn't run the script at boot.
any ideas,
i am running linux red hat 8.0
thanks,
jh
|
|
|
07-14-2003, 05:31 PM
|
#2
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
That is usually the file to place them in but I believe it depends on what runlevel you startup in, as Redhat changes these around, could be in /etc/rc.d/init.d or so forth. I no longer use Redhat, but sometimes they will have a link to each runlevel in /etc/ named like rc.0 or rc.3 and so forth. If you boot into runlevel 3, place the script where the link /etc/rc.3 is linked to.
|
|
|
07-14-2003, 05:32 PM
|
#3
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
/etc/rc.d/rc.local is a good place. But if it's a script, it may be better to put it to /etc/rc.d/init.d/ and symplnk it to the right runlevel (for example /etc/init.d/rc3.d/S50yourservice). 'rc3.d' means it's runlevel 3 (console, multiuser, with network), 'S50' means to start the service (S), numbers are priorities.
|
|
|
07-14-2003, 05:35 PM
|
#4
|
Moderator
Registered: May 2001
Posts: 29,415
|
...and if you're still wondering why it didn't work while you had in incorporated in rc.local, debugging shouldn't be hard if you make it a separate script and do "sh -x <script> (args) 2>&1|tee /tmp/script.log", then read /tmp/script.log if it did fly by to fast.
Else post the script(+log).
|
|
|
07-14-2003, 05:39 PM
|
#5
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
/etc/rc.d/rc.local is a good place. But if it's a script, it may be better to put it to /etc/rc.d/init.d/ and symplnk it to the right runlevel (for example /etc/init.d/rc3.d/S50yourservice). 'rc3.d' means it's runlevel 3 (console, multiuser, with network), 'S50' means to start the service (S), numbers are priorities.
sorry kind of a newbie,
i have the script called startup.sh , how would i add this to the /etc/initd/rc3.d/ ?
thanks
|
|
|
07-14-2003, 05:43 PM
|
#6
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
/etc/rc.d/init.d/ directory, simply copy your script inside. Then you need to create a symplnik from this file (copied). The symplink should be placed in the right directory /etc/rc?.d/
|
|
|
07-14-2003, 05:59 PM
|
#7
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
okay i copied the script to the folder /etc/rc.d/init.d,
how do i create the symplnik though? once created do i put it in /etc/rc3.d?
thanks, and sorry for the questions.
|
|
|
07-14-2003, 06:15 PM
|
#8
|
Member
Registered: Oct 2002
Location: Mexico
Distribution: RedHat 9.0 and SuSE 8.1
Posts: 229
Rep:
|
Just:
ln -s /etc/rc.d/init.d/startup.sh /etc/rc.d/rc3.d/S50startup
|
|
|
07-14-2003, 06:22 PM
|
#9
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
COOL I'LL GIVE THIS A TRY AND LET YOU GUYS KNOW HOW IT WORKS.
|
|
|
07-15-2003, 10:43 AM
|
#10
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
no luck, it didn't start. i had to run the script manually. is there a was to test it, without having to reboot? does anyone know how i can troubleshoot this?
thanks,
|
|
|
07-15-2003, 11:15 AM
|
#11
|
Member
Registered: Oct 2002
Location: Mexico
Distribution: RedHat 9.0 and SuSE 8.1
Posts: 229
Rep:
|
On which level are you booting??
|
|
|
07-15-2003, 11:18 AM
|
#12
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
rc3.d
|
|
|
07-15-2003, 11:44 AM
|
#13
|
Member
Registered: Oct 2002
Location: Mexico
Distribution: RedHat 9.0 and SuSE 8.1
Posts: 229
Rep:
|
Quote:
Originally posted by angelrod
Just:
ln -s /etc/rc.d/init.d/startup.sh /etc/rc.d/rc3.d/S50startup
|
You know, it was my mistake. The rigth path is:
ln -s /etc/rc.d/init.d/startup.sh /etc/rc3.d/S50startup
|
|
|
07-15-2003, 12:08 PM
|
#14
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
somehow it got created in the /etc/rc3.d/ directory. because i have it in both the /etc/rc.d/rc3.d and in /etc/rc3.d. and i did a diff on both and there is no differences.
any ideas,
thanks
|
|
|
07-15-2003, 03:35 PM
|
#15
|
Member
Registered: Oct 2002
Location: Mexico
Distribution: RedHat 9.0 and SuSE 8.1
Posts: 229
Rep:
|
Yes, it was created in both folders because the /etc/rcX.d are symbolic links to the real ones /etc/rc.d/rcX.d
It's weird that the script doesn't execute when booting in text mode (level 3).
If you go to /etc/rc.d/init.d and you try to execute the script like:
./startup.sh
Does it executes normally??
|
|
|
All times are GMT -5. The time now is 07:26 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|