LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 11-21-2005, 02:39 AM   #1
quintan
LQ Newbie
 
Registered: Aug 2005
Posts: 11

Rep: Reputation: 0
'cannot stat' script in /etc/rc.d/, try to run script at startup


I want to run a script at machine startup. I think I should copy the script to /etc/init.d?? But when I try to do so, I get message :

'cp: cannot stat 'script.sh' : No such file or directory

But the file is there in the directory.

Any suggestions?
 
Old 11-21-2005, 02:53 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,158
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
1st. Is the script executable? Run:
Code:
chmod +x script.sh
2. What distro are you using? If your distro uses /etc/init.d then you must create a symlink from your default runlevel to the script, i.e. if your default runlevel is 3, then:
Code:
ln -s /etc/init.d/script.sh /etc/rc3.d/S99script
If your distro uses /etc/rc.d then add a line in /etc/rc.d/rc.local containing the name of the script
 
  


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 at Startup?? usaf_sp SUSE / openSUSE 5 11-11-2005 01:43 PM
get a script to run on startup kram Debian 3 04-23-2005 02:23 PM
'run as' from rc.5 startup script davee Linux - General 2 03-10-2005 02:36 AM
Run a script at startup iain.ross Linux - Newbie 8 08-27-2004 04:03 PM
How to run script on startup Angelis Linux - General 1 11-16-2003 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:42 AM.

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