LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
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/Novell 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


All times are GMT -5. The time now is 05:29 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration