LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Can't get script to run from symlink in etc/init.d (https://www.linuxquestions.org/questions/debian-26/cant-get-script-to-run-from-symlink-in-etc-init-d-507123/)

goggyturk 12-03-2006 12:08 PM

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;)

bigrigdriver 12-03-2006 02:36 PM

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

What's the output of ls?

HappyTux 12-03-2006 02:58 PM

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.

goggyturk 12-04-2006 12:46 PM

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.

HappyTux 12-04-2006 01:22 PM

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.

goggyturk 12-05-2006 12:34 PM

That seems to have fixed it.

Thanks a lot for your help!


All times are GMT -5. The time now is 12:10 AM.