On Thu, 16 Dec 2004, Matthew Miller wrote:
> On Thu, Dec 16, 2004 at 06:54:19PM +0100, Mike Becher wrote:
> > I work on ia64_linux26 stuff for openafs. Anytime I try to use CVS
> > snapshots or unstable versions of source code I have to apply a patch to
> > afs.rc.linux to make it work for Linux 2.6. The nameing conventions for
> > modules is now "<module>.ko". The patch makes afs.rc able to distiguish
> > between module extensions for old and new nameing convention.
>
> You may want to take a look at the new client init script from my
> 1.3.x RPMs for Fedora Core -- <http://www.mattdm.org/misc/openafs/>.
OK, I have taken a look at your openafs-init.sh. It depends really on
redhat based distributions.
Comments:
* Patch supplied make it work on other systems (I hope).
There are some functions and features which only exists on redhat
systems like echo_failure, echo_success and daemon.
Additionally /etc/rc.d/init.d/functions exists only on redhat.
* If "openafs-init.sh stop" will be called it is better to kill all
processes which CWD is in /afs or which have files open in /afs.
You can find out such processes with for example
lsof | awk '($NF ~ /^\/afs/){print $2}' | uniq
Then seend them a kill -HUP <pids> and after some times scan again and
send a kill -KILL <pids> then umount will probably not fail.
* If you want that openafs-init.sh should umount AFS only when there are
no clients of /afs then provide another option like for example
openafs-init.sh softstop
* SuSE need also some suggestions for default Start/Stop runlevels.
best regards
mike
>
> (If unpacking the src rpm is a pain for you, let me know, and I can send you
> the init script directly.)
>
> As always, anyone's help in making this better is much appreciated.
>
>
> --
> Matthew Miller [EMAIL PROTECTED] <http://www.mattdm.org/>
> Boston University Linux ------> <http://linux.bu.edu/>
> --- openafs-init.sh.orig 2004-06-18 19:25:51.000000000 +0200
+++ openafs-init.sh 2004-12-17 08:17:13.665910710 +0100
@@ -22,13 +22,41 @@
# Provides: afs
# Required-Start: $network
# Required-Stop: $network
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Description: AFS is a distributed file system which provides location
+# transparency, caching and secure authentication.
+# Additional configuration can be done in the /etc/sysconfig/afs
+# file. Read the documentation in that file for more information.
+### END INIT INFO
+
+
### END INIT INFO
# Note that AFS does not use a pid file in /var/run. It is turned off by
# unmounting /afs.
# Source function library.
-. /etc/rc.d/init.d/functions
+# check for special bootup functions
+if [ -f /etc/rc.d/init.d/functions ] ; then
+ . /etc/rc.d/init.d/functions
+else
+ # special (RedHat) functions etc. not available...
+ # so I provide neccessary replacements (e.g. for SuSE)
+
+ function echo_failure () { echo -n " - failed." ; }
+
+ function echo_success () { echo -n " - successful." ; }
+
+ function daemon () { $* ; }
+
+ amIroot=`/usr/bin/id -u`
+ if [ ! -d /var/lock/subsys -a "_$amIroot" = "_0" ] ; then
+ mkdir -p /var/lock/subsys
+ fi
+
+ # these are hopefully all redhat specific stuff I use...
+fi
SYSCNF=/etc/sysconfig/afs