Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Script Dependancy Problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
swingarm
l33t
l33t


Joined: 08 Jun 2002
Posts: 627
Location: Northern Colorado

PostPosted: Mon Jun 23, 2003 6:31 am    Post subject: Script Dependancy Problem Reply with quote

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
View user's profile Send private message
Brandy
Bodhisattva
Bodhisattva


Joined: 08 Jun 2003
Posts: 820
Location: New Zealand

PostPosted: Tue Jun 24, 2003 3:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum