LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 12-03-2006, 12:08 PM   #1
goggyturk
LQ Newbie
 
Registered: Oct 2003
Posts: 22

Rep: Reputation: 15
Can't get script to run from symlink in etc/init.d


Hello folks

Got a problem with a script that loads a couple of kernel modules for scsi emulation for my cd/dvd (literally two lines). The script runs fine from its home in /usr/local/bin but when I create a symbolic link in /etc/init.d it refuses to recognise the file exists:

turknet01:/etc/init.d# ./cd-scsi-loader console
bash: ./cd-scsi-loader: No such file or directory

It refuses to recgnise the file under update-rc.d also. The original file has rwx permissions under root, r-- for all others. Anyone have any ideas? Sure this is a simple fix for some of you gurus out there
 
Old 12-03-2006, 02:36 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,764

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
From a console window, do 'ls -l /etc/init.d/cd-scsi-loader'.

What's the output of ls?
 
Old 12-03-2006, 02:58 PM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 63
Quote:
Originally Posted by goggyturk
Hello folks

Got a problem with a script that loads a couple of kernel modules for scsi emulation for my cd/dvd (literally two lines). The script runs fine from its home in /usr/local/bin but when I create a symbolic link in /etc/init.d it refuses to recognise the file exists:

turknet01:/etc/init.d# ./cd-scsi-loader console
bash: ./cd-scsi-loader: No such file or directory

It refuses to recgnise the file under update-rc.d also. The original file has rwx permissions under root, r-- for all others. Anyone have any ideas? Sure this is a simple fix for some of you gurus out there
You would put the file in the /etc/init.d directory then use the update-rc.d command to create the proper startup/shutdown link(s) but you really should be if using ide-scsi for the drives using the kernel parameter for them. If using LILO you want something like this in the append= line in the /etc/lilo.conf hdc=ide-scsi hdd=ide-scsi then run /sbin/lilo -v to update LILO and reboot. If using Grub you would either put them on the kernel line in the /boot/grug/menu.lst eg.

Code:
## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.19-ck1-smp Default
root            (hd0,1)
kernel          /boot/vmlinuz root=/dev/sda2 ro hdc=ide-scsi hdd=ide-scsi
savedefault
This would be for the running kernel if you want all kernels to get this then edit this section.

Code:
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/sda2 ro hdc=ide-scsi hdd=ide-scsi
This would on every Grub update put the scsi emulation on the kernels available for booting. You should make sure to use the proper drive letters for the cd/dvd as if you make your hard drive use the emulation it will not boot so change the hdc and hdd as necessary.
 
Old 12-04-2006, 12:46 PM   #4
goggyturk
LQ Newbie
 
Registered: Oct 2003
Posts: 22

Original Poster
Rep: Reputation: 15
To reply to both of you...

Output of ls -l ...:

Code:
lrwxrwxrwx  1 root root 28 2006-12-03 17:38 /etc/init.d/cd-scsi-loader -> usr/local/bin/cd-scsi-loader
Already had a look at this and couldn't see any probs - points to the right place and has the permissions.. any ideas bigrigdriver?

HappyTux, I already edited /boot/grub/menu.lst with the ide-scsi flags for my two drives. It seems to work OK except for one of the driver modules that isn't loaded on boot automatically:

Code:
/sbin/insmod sg
The ide-scsi module is loaded automatically and I want to avoid having to type this manually each time I log in.

Thanks in advance for any ideas

G.

Last edited by goggyturk; 12-04-2006 at 12:48 PM.
 
Old 12-04-2006, 01:22 PM   #5
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 63
Quote:
Originally Posted by goggyturk

HappyTux, I already edited /boot/grub/menu.lst with the ide-scsi flags for my two drives. It seems to work OK except for one of the driver modules that isn't loaded on boot automatically:

Code:
/sbin/insmod sg
The ide-scsi module is loaded automatically and I want to avoid having to type this manually each time I log in.

Thanks in advance for any ideas

G.
Just put the sg on a line by itself in the /etc/modules file and it will be loaded on boot.
 
Old 12-05-2006, 12:34 PM   #6
goggyturk
LQ Newbie
 
Registered: Oct 2003
Posts: 22

Original Poster
Rep: Reputation: 15
Thumbs up

That seems to have fixed it.

Thanks a lot for your help!
 
  


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
How to find symlink target name in script germanyzulu Linux - Software 3 08-09-2006 03:14 PM
/etc/X11/xinit/.Xmodmap; run level 4 won't init script Potatopopper Slackware 5 11-27-2005 07:37 PM
why isn't this php symlink script working verbatim Programming 8 04-27-2005 09:13 AM
init script won't run at log-off dimangi Linux - Newbie 1 10-29-2003 02:19 AM
setting script to run when system enter init 3 fowlerlfc Linux - Newbie 2 10-29-2002 03:02 PM


All times are GMT -5. The time now is 01:15 AM.

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