View previous topic :: View next topic |
Author |
Message |
swingarm l33t
Joined: 08 Jun 2002 Posts: 627 Location: Northern Colorado
|
Posted: Mon Jun 23, 2003 6:31 am Post subject: Script Dependancy Problem |
|
|
I have this script that was posted as a response to one of my previous postings, it automatically modprobes and mounts my external firewire hard drive:
Code: |
#!/sbin/runscript
depend() {
use logger
# need pcmcia
}
MOUNT_DEVICE=/dev/sda2
MOUNT_POINT=/mnt/bafo
DISK_NAME=BAFO
start() {
ebegin "${DISK_NAME} startup"
if [ -z "`grep "${MOUNT_DEVICE} ${MOUNT_POINT} " /etc/mtab`" ]
then
einfo "Loading needed modules"
modprobe -s ieee1394
if [ "$?" -ne 0 ]
then
eerror "Failed to load ieee1394 module"
return 1
fi
modprobe -s ohci1394
if [ "$?" -ne 0 ]
then
eerror "Failed to load ohci1394 module"
return 1
fi
sleep 2
modprobe -s sbp2
if [ "$?" -ne 0 ]
then
eerror "Failed to load sbp2 module"
return 1
fi
sleep 2
einfo "Mounting ${DISK_NAME}"
mount ${MOUNT_POINT}
if [ "$?" -ne 0 ]
then
eerror "Failed to mount ${DISK_NAME}"
return 1
fi
fi
eend
return
}
stop() {
ebegin "${DISK_NAME} shutdown"
einfo "Unmounting ${DISK_NAME}"
umount -r ${MOUNT_POINT}
einfo "Unloading modules"
modprobe -r sbp2
modprobe -r ohci1394
modprobe -r ieee1394
eend
}
|
It works fine except for this dependancy error I'm now getting after I rsync'd and did the 'emerge -Up world' this morning:
Code: |
sh-2.05b# ~/firewire-mount-script.sh start
* Could not get dependency info for "firewire-mount-script.sh"!
* Could not get dependency info for "firewire-mount-script.sh"!
* DRIVE_NAME startup...
* Loading needed modules
* Mounting DRIVE_NAME
|
The computer modprobes fine and mounts the hard drive fine but I can't get rid of that error. I think it's there because it upgraded the baselayout when I rsync'd and did the 'emerge -Up world' this morning. The last time I rsync'd was yesterday. |
|
Back to top |
|
|
Brandy Bodhisattva
Joined: 08 Jun 2003 Posts: 820 Location: New Zealand
|
Posted: Tue Jun 24, 2003 3:27 am Post subject: |
|
|
Hi swingarm.
I'm still very much a noob so I'm not sure that I can help you.
The rc-scripts determine their dependencies by looking at the dependency-cache in /var/lib/init.d (the location of this file is specified by svcdir="path/to/init.d" in /etc/conf.d/rc).
You could manually add an entry for your script to /var/lib/init.d. (I'm not sure if there's a way to automatically add it)
Code: | depinfo_firewire-mount-script.sh() {
export rc_name="firewire-mount-script.sh"
export rc_ineed=
export rc_needsme=
export rc_iuse="logger"
export rc_usesme=
export rc_ibefore="local"
export rc_iafter="checkroot"
export rc_broken=
export rc_parallel=
} |
As I said earlier, I'm a noob so I'm not 100% sure this will resolve your problem.
Ciao, Brandy _________________ Faber est suae quisque fortunae. |
|
Back to top |
|
|
|