]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Add rc.d links.
authorSam Hartman <hartmans@debian.org>
Thu, 23 Nov 2000 22:11:35 +0000 (22:11 +0000)
committerSam Hartman <hartmans@debian.org>
Thu, 23 Nov 2000 22:11:35 +0000 (22:11 +0000)
Modify init.d script to support  force-starte
Add debconf support to afs.conf

debian/openafs-client.config
debian/openafs-client.templates
debian/openafs-fileserver.postinst
debian/rules
src/afsd/afs.conf.linux
src/afsd/afs.rc.linux

index ac513768ec060ac42a824befc1b46394f48b3a80..7bf23d03d797a173411113be7009240940be546b 100644 (file)
@@ -4,8 +4,11 @@
 
 db_version 2.0
 db_input medium openafs-client/thiscell ||true
-db_go
-
 db_input high openafs-client/cachesize ||true
-
+db_go
+test -f /etc/openafs/afs.conf &&. /etc/openafs/afs.conf
+if [ "x$AFS_CLIENT" != "x" ] ; then
+    db_set openafs-client/run-client  $AFS_CLIENT
+    fi
+db_input low openafs-client/run-client || true
 db_go
index bdae9cd6cbc361da6739bcc73957d0482f56569f..74d419b5c4a59d1e4ce91799511b8e25eb06a99f 100644 (file)
@@ -1,3 +1,18 @@
+Template: openafs-client/cell-info
+Type: string
+Description: What hosts are DB servers for your home cell?
+ AFS uses the file /etc/openafs/CellServDB to hold the list of servers
+ that should be contacted to find parts of a cell.  The cell you claim
+ this workstation belongs to is not in that file.  Enter the host
+ names of the database servers separated by spaces.
+ IMPORTANT: If you are creating a new cell and this machine is to be
+ a database server in that cell, only enter this machine's name; add
+ the other servers later after they are functioning. Also, do not
+ enable the AFS client to start at boot on this server until the cell
+ is configured.  When you are ready you can edit
+ /etc/openafs/afs.conf.client to enable the client.
+
+
 Template: openafs-client/thiscell
 Type: string
 Description:  What AFS cell does this workstation belong to?
@@ -5,7 +20,7 @@ Description:  What AFS cell does this workstation belong to?
    Each workstation belongs to one cell.  Usually the cell is the DNS
    domain name of the workstation.
 
-template: openafs-client/cachesize
+Template: openafs-client/cachesize
 Type: string
 Default: 50000
 Description:  How large is your AFS cache (kb)? 
@@ -15,11 +30,13 @@ Description:  How large is your AFS cache (kb)?
    on.  Often, people find it useful to dedicate a partition to their
    AFS cache.
 
-Template: openafs-client/nohomecell
-Type: note
-Description: Your home cell is not in CellServDb
- AFS uses the file /etc/openafs/CellServDB to hold the list of servers
- that should be contacted to find parts of a cell.  The cell you claim
- this workstation belongs to is not in that file.  You must either
- change the home cell of this workstation or edit CellServDB to add a
- new cell.
+Template: openafs-client/run-client
+Type: boolean
+Default: true
+Description: Run Openafs client at boot?
+ Should the Openafs filesystem be started and mounted at boot?
+ Normally, most users who install the openafs-client package expect to
+ run it at boot.  However, if you are planning on setting up a new
+ cell or are on a laptop, you may not want it started at boot time.
+ If you answer no to this question, run /etc/init.d/openafs-client
+ force-start to run.
index accc93c31d4ddad88c3811e3f3e32537bd453722..edac36cd16bb9348b0b3ef5d83f1898f0a268d79 100644 (file)
@@ -33,3 +33,6 @@ esac
 
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
+#DEBHELPER#
+
+exit 0
index 2d3636d8f6e2f477065d867d6b061db0d1e152e7..06535f5617c5cb46d22c31bc0ee6720391928678 100755 (executable)
@@ -74,8 +74,7 @@ install: build
 
        # Add here commands to install the package into debian/tmp.
        cat debian/filelist |sh debian/movefiles
-       cp dest/root.client/usr/vice/etc/afs.rc debian/openafs-client/etc/init.d/openafs-client
-       chmod 755 debian/openafs-client/etc/init.d/openafs-client
+       cp dest/root.client/usr/vice/etc/afs.rc debian/openafs-client.init
        cp dest/root.client/usr/vice/etc/afs.conf debian/openafs-client/etc/openafs/afs.conf
        install -m 755 -o root -g root debian/afs-rootvol debian/openafs-dbserver/usr/sbin
        (cd debian&&pod2man --section 8 --center "Debian GNU/Linux"  \
@@ -126,7 +125,7 @@ binary-arch: build install
        dh_installmenu
 #      dh_installemacsen
 #      dh_installpam
-#      dh_installinit
+       dh_installinit -r
        dh_installcron
 #      dh_installmanpages
        dh_installinfo
index a368504080a6ed2e56a61744424b30efaca9ee9e..21f87763195c078c9176734b1631643e27051fc6 100644 (file)
@@ -9,8 +9,10 @@
 # Configuration information for AFS client
 
 # AFS_CLIENT and AFS_SERVER determine if we should start the client and or
-# the bosserver. Possible values are on and off.
-AFS_CLIENT=on
+# the bosserver. Possible values are true and false.
+# These are loaded from files written by debconf
+test -f /etc/openafs/afs.conf.client && . /etc/openafs/afs.conf.client
+
 AFS_SERVER=off
 
 # AFS client configuration options:
index 2d1dd10297cb5c79cc6c8efe5e2cde6612037dd5..d84cfeb5712d9800756006c8bd7ced486576c6f3 100644 (file)
@@ -24,9 +24,9 @@ if [ -f /etc/openafs/afs.conf ]; then
        . /etc/openafs/afs.conf
 fi
 
-# is_on returns 1 if value of arg is "on"
+# is_on returns 1 if value of arg is "true"
 is_on() {
-       if  test "$1" = "on" ; then return 0
+       if  test "$1" = "true" ; then return 0
        else return 1
        fi
 }
@@ -123,9 +123,21 @@ load_client() {
 
        # use the prefix command if required
        set_prefix
-       /sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1
+               LOADED=`/sbin/lsmod | fgrep openafs`
+       if [ -z "$LOADED" ] ; then
+           /sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1
+       fi
+}
+
+# start_client() -- run afsd
+start_client() {
+               start-stop-daemon --start --quiet --exec /usr/sbin/afsd \
+                   -- ${OPTIONS}
+               echo -n " afsd"
+
 }
 
+
 case "$1" in 
   start)
        # Load kernel extensions
@@ -136,40 +148,40 @@ case "$1" in
        fi
 
        echo -n "Starting AFS services: "
-       # Start bosserver, it if exists
-       if  is_on $AFS_SERVER && test -x /usr/afs/bin/bosserver  ; then
-               start-stop-daemon --start --quiet --pidfile /var/run/bos.pid \
-                   --exec /usr/afs/bin/bosserver
-               echo -n " bosserver"
-       fi
-
        # Start AFS client
        if  is_on $AFS_CLIENT && test -x /usr/sbin/afsd  ; then
-               start-stop-daemon --start --quiet --exec /usr/sbin/afsd \
-                   -- ${OPTIONS}
-               echo -n " afsd"
-
+       start_client
                echo "."
                $AFS_POST_INIT
        fi
 
        ;;
 
-  stop)
+force-start)
+       # Load kernel extensions
+       if  load_client  ; then :
+       else
+               echo Failed to load AFS client, not starting AFS services.
+               exit 1
+       fi
+
+       echo -n "Starting AFS services: "
+       # Start AFS client
+       if test -x /usr/sbin/afsd  ; then
+       start_client
+               echo "."
+               $AFS_POST_INIT
+       fi
+       ;;
+  stop|force-stop)
        # Stop AFS
        echo -n "Stopping AFS services: "
 
-       if  is_on $AFS_CLIENT  ; then
+       if  mount |grep -q \^AFS  ; then
                umount /afs
                echo -n " afsd"
        fi
 
-       if  is_on $AFS_SERVER && test -x /usr/afs/bin/bos ; then
-               echo "Stopping AFS bosserver"
-               /usr/afs/bin/bos shutdown localhost -localauth -wait
-               start-stop-daemon --stop --quiet --signal 1 \
-                   --pidfile /var/run/bos.pid
-       fi
 
        LIBAFS=`/sbin/lsmod | fgrep openafs`
        if [ -n "$LIBAFS" ] ; then