[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Starting a service (was: Loading kernel modules at boot)



On Mar 19, 2006, at 6:48 PM, Joe Steele wrote:
> Stephen Cristol wrote:
>> "condor" is a service that I have written. It works nicely once the
>> fuse module has been loaded. So far, that has required manually using
>> modprobe.
>
> Why not have the modprobe included as part of the start-up of the  
> condor
> service?

Thanks, Joe.

Another excellent suggestion. Putting modprobe into the service  
script or into rc.local works to load the kernel module. Naturally,  
this has unmasked another problem (hence the new subject line).

It seems that even with the kernel module loaded, the service is  
failing to start. On the start-up screen, I am getting the error  
message "fusermount: mount failed: permission denied". I've included  
the "condor" script below. After start-up, the service is stopped,  
but starts without difficulty:

[sc ~]$ sudo /sbin/service condor status
wdfs is stopped
[sc ~]$ sudo /sbin/service condor start
Mounting (starting) wdfs:                                  [  OK  ]
[sc ~]$

Since this service script gets run as root, I was surprised by the  
"permission denied". Any suggestions on why this isn't working?

Thanks,
S



Condor script:

#!/bin/sh
#
# Startup script for webdavfs
#
# chkconfig: 35 99 99
# description: Mount a WebDAV server as a file system

. /etc/rc.d/init.d/functions

export PATH="/usr/local/bin:$PATH"
CONDOR_SVC="wdfs"
DO_START="$CONDOR_SVC /net/dav -a http://test.webdav.org/dav/";
DO_STOP="fusermount -u /net/dav"


start() {
         echo -n "Mounting (starting) $CONDOR_SVC: "
         modprobe fuse
         daemon $DO_START
         RETVAL=$?
         echo
         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$CONDOR_SVC
}

stop() {
         echo -n "Unmounting (stopping) $CONDOR_SVC: "
         $DO_STOP
         echo
         rm -f /var/lock/subsys/$CONDOR_SVC
}

case "$1" in
   start)
         start
         ;;
   stop)
         stop
         ;;
   status)
         status $CONDOR_SVC
         ;;
   restart)
         stop
         start
         ;;
   *)
         echo "Usage: $0 {start|stop|restart|status}"
         exit 1
esac

exit 0