SHA256
1
0
forked from pool/openafs

- cleanup last cleanup: also remove rc.* files

OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=2
This commit is contained in:
Christof Hanke 2018-03-15 08:28:02 +00:00 committed by Git OBS Bridge
parent a7c8d16e59
commit c4146b5b07
4 changed files with 5 additions and 964 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Mar 15 08:28:10 UTC 2018 - christof.hanke@mpcdf.mpg.de
- cleanup last cleanup: also remove rc.* files
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Mar 6 10:03:44 UTC 2018 - christof.hanke@mpcdf.mpg.de Tue Mar 6 10:03:44 UTC 2018 - christof.hanke@mpcdf.mpg.de

View File

@ -1,372 +0,0 @@
#! /bin/sh
# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany.
#
# Author: Peter Poeml <poeml@suse.de>, 2001
# Additions by Christof Hanke <biber@induhviduals.de>, 2009
#
# /etc/init.d/afs-server
# and its symbolic link
# /usr/sbin/rcafs-server
#
# System startup script for OpenAFS
#
### BEGIN INIT INFO
# Provides: afs-client
# Required-Start: $local_fs
# Should-Start: $syslog $network $time
# Should-Stop: $null
# Required-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 2 1 6
# X-UnitedLinux-Default-Enabled: yes
# Short-Description: Start OpenAFS Client
# Description: Starts the OpenAFS Client by loading the required kernel-module and starting afsd.
### END INIT INFO
DAEMON="OpenAFS Client"
DAEMON_PIDFILE=
STARTPROC_LOGFILE=
SUPPORTS_HUP="no"
DAEMON_BIN=/usr/sbin/afsd
AFS_KERNEL_MODULE=libafs
#test -x $DAEMON_BIN || exit 5
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num><num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
. /etc/sysconfig/openafs-client
CACHEINFO=${CACHEINFO:-/etc/openafs/cacheinfo}
CACHE=${CACHEDIR:-/var/cache/openafs}
AFS=${AFSDIR:-/afs}
REGENERATE_CELL_INFO=${REGENERATE_CELL_INFO:-no}
REGENERATE_CACHE_INFO=${REGENERATE_CACHE_INFO:-yes}
MEMCACHE=${MEMCACHE:-yes}
VERBOSE=${VERBOSE:-no}
DYNROOT=${DYNROOT:-yes}
FAKESTAT=${FAKESTAT:-yes}
AFSDB=${AFSDB:-yes}
DATA_ENCRYPTION=${DATA_ENCRYPTION:-yes}
THIS_CELL_SERVER_NAME=${THIS_CELL_SERVER_NAME:-unknown}
SERVER_TIMEOUT=120
check_configfiles() {
if [ ! -f /etc/openafs/ThisCell ]; then
echo "Invalid configuration. Cellconfiguration in /etc/openafs/ThisCell is missing."
rc_failed 1
return
fi
if [ "$AFSDB" = "no" ] ; then
if [ ! -f /etc/openafs/CellServDB ]; then
echo "No CellServDB found and AFSDB=no."
echo "Either set AFSDB=yes in /etc/sysconfig/openafs [recommended] or"
echo "populate the /etc/openafs/CellServDB file"
rc_failed 1
return
fi
if [ "`grep -c \>$THIS_CELL /etc/openafs/CellServDB`" != "1" ] ; then
echo "Cannot find unique definition of your cell $THIS_CELL in /etc/openafs/CellServDB."
echo "Consider setting AFSDB=yes in /etc/sysconfig/openafs or"
echo "fix /etc/openafs/CellServDB."
rc_failed 1
fi
fi
}
generate_cellinfo() {
if [ "$REGENERATE_CELL_INFO" = "yes" -a "x$THIS_CELL" != "x" ]; then
rm -f /etc/openafs/ThisCell #it could be symlinks to server configuration
echo "$THIS_CELL" > /etc/openafs/ThisCell
if [ -f /etc/openafs/CellServDB -a ! -L /etc/openafs/CellServDB ]; then
if grep -q "^>$THIS_CELL\([[:space:]#].*\)\?$" /etc/openafs/CellServDB ; then
# CellServDB contains THIS_CELL, replace servers
awk "
/^>$THIS_CELL([[:space:]#].*)?$/ {
this_cell=1;
print \$0;
print \"$THIS_CELL_SERVER #$THIS_CELL_SERVER_NAME\";
next
}
/^>/ {
this_cell=0;
print \$0;
next
}
/^[^>[:space:]]+/ {
if (!this_cell) print \$0;
}
" /etc/openafs/CellServDB > /etc/openafs/CellServDB.new
else
# add THIS_CELL to CellServDB
echo ">$THIS_CELL #Cell name, generated from /etc/sysconfig/afs-client" >/etc/openafs/CellServDB.new
echo "$THIS_CELL_SERVER #$THIS_CELL_SERVER_NAME" >>/etc/openafs/CellServDB.new
cat /etc/openafs/CellServDB >> /etc/openafs/CellServDB.new
fi
mv -f /etc/openafs/CellServDB.new /etc/openafs/CellServDB
else
# new CellServDB
rm -f /etc/openafs/CellServDB #it could be symlinks to server configuration
echo ">$THIS_CELL #Cell name, generated from /etc/sysconfig/afs-client" >/etc/openafs/CellServDB
echo "$THIS_CELL_SERVER #$THIS_CELL_SERVER_NAME" >>/etc/openafs/CellServDB
fi
fi
}
generate_cacheinfo() {
if [ "$REGENERATE_CACHE_INFO" = "yes" -a "x$CACHESIZE" != "x" ]; then
if [ "$CACHESIZE" = "AUTOMATIC" ]; then
if [ "$MEMCACHE" = "yes" ]; then
useCACHESIZE=`awk '/^MemTotal:/{ print int($2 / 8);}' /proc/meminfo`
else
LINE=`df -k $CACHE | tail -1`
PART=`echo $LINE | awk '{ if ( ($NF != "/usr") && ($NF != "/") && ($NF != "/var") ) print $NF; else print "NONE";}'`
if [ "$PART" = "NONE" ]; then
echo "$CACHE is not a separate partition"
echo "you have to change the cachesize in $SYSCNF by hand"
return 1
else
PARTSIZE=`echo $LINE | awk '{print $2}'`
useCACHESIZE=`echo $PARTSIZE | awk '{printf "%d",int(($1*.8)/1024)*1024}'`
fi
fi
else
useCACHESIZE=$CACHESIZE
fi
echo $AFS:$CACHE:$useCACHESIZE >$CACHEINFO
chmod 0644 $CACHEINFO
mkdir -p $CACHE # to be sure
else
useCACHESIZE=`awk -F: '{print $3}' < $CACHEINFO`
fi
return 0
}
choose_afsdoptions() {
if [ "x$OPTIONS" = "x" -o "x$OPTIONS" = "xAUTOMATIC" ]; then
if [ $useCACHESIZE -lt 131072 ]; then
OPTIONS=$SMALL
elif [ $useCACHESIZE -lt 524288 ]; then
OPTIONS=$MEDIUM
elif [ $useCACHESIZE -lt 1048576 ]; then
OPTIONS=$LARGE
elif [ $useCACHESIZE -lt 2097152 ]; then
OPTIONS=$XLARGE
else
OPTIONS=$XXLARGE
fi
fi
AFSD_OPTIONS="$OPTIONS"
if [ "$MEMCACHE" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -memcache"
if [ "x$OPTIONS" != "x" -a "x$CACHESIZE" != "xAUTOMATIC" ];then
AFSD_OPTIONS="$AFSD_OPTIONS -blocks $useCACHESIZE"
fi
fi
if [ "$VERBOSE" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -verbose"
fi
if [ "$DYNROOT" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -dynroot"
fi
if [ "$FAKESTAT" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -fakestat"
fi
if [ "$AFSDB" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -afsdb"
fi
}
killafs() {
SIGNAL=$1
PIDS=`lsof -Fp $AFS | sed -e 's/p//'`
if [ "x" != "x$PIDS" ]; then
kill -$SIGNAL $PIDS >/dev/null 2>&1
sleep 3
fi
}
wait_for_server() {
TIMEOUT=$SERVER_TIMEOUT
if [ -f /usr/sbin/bosserver ] && checkproc /usr/sbin/bosserver ; then
# we run on the same machine as the server
while /usr/sbin/bos status localhost -localauth |grep -q "salvaging file system"; do
echo
echo -n "Waiting for local AFS server to come up ..."
sleep 1
TIMEOUT=$(( $TIMEOUT - 1 ))
[ $TIMEOUT -eq 0 ] && return 1
done
fi
return 0
}
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
case "$1" in
start)
echo "Starting $DAEMON "
mkdir -p $AFS
if generate_cacheinfo; then
generate_cellinfo
check_configfiles
choose_afsdoptions
if /sbin/modprobe --allow-unsupported-modules $AFS_KERNEL_MODULE ; then
if wait_for_server; then
ps ax | grep -q '\[afsd\]' || $DAEMON_BIN $AFSD_OPTIONS || rc_failed 1
if [ "$DATA_ENCRYPTION" = "yes" ]; then
/usr/bin/fs setcrypt on
fi
if [ "x$SYSNAME" != "x" ]; then
/usr/bin/fs sysname $SYSNAME
fi
else
#local server not running
rc_failed 1
fi
else
#modprobe failed
rc_failed 5
fi
else
rc_failed 6
fi
# Remember status and be verbose
rc_status -v
;;
stop)
[ "x`whoami`" = xroot ] || exit 4 # do not allow regular user to kill all his processes
echo -n "Shutting down $DAEMON "
if ps ax | grep -q '\[afsd\]'; then
echo
echo "Sending all processes using $AFS the TERM signal ..."
killafs TERM
echo "Sending all processes using $AFS the KILL signal ..."
killafs KILL
umount $AFS
fi
if grep -q ^$AFS_KERNEL_MODULE /proc/modules ; then
/sbin/rmmod $AFS_KERNEL_MODULE || rc_failed 1
fi
# rmtsys doesn't go away, so kill them all to be sure
killall $DAEMON_BIN > /dev/null 2>&1
# Remember status and be verbose
rc_status -v
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
$0 stop && $0 start
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
## If it does not support it, restart.
echo -n "Reload service $DAEMON"
if [ "$SUPPORTS_HUP" = "yes" ] ; then
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
#touch $DAEMON_PIDFILE
rc_status -v
else
$0 stop && $0 start
rc_status
fi
;;
reload)
## Like force-reload, but if daemon does not support
## signalling, do nothing (!)
if [ "$SUPPORTS_HUP" = "yes" ] ; then
# If it supports signalling:
echo -n "Reload service $DAEMON"
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
#touch $DAEMON_PIDFILE
rc_status -v
else
## Otherwise if it does not support reload:
rc_failed 3
rc_status -v
fi
;;
status)
echo -n "Checking for $DAEMON: "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
ps ax | grep -q '\[afsd\]' || rc_failed 3
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload,
## give out the argument which is required for a reload.
if [ "$DAEMON_CONF" -nt "$DAEMON_PIDFILE" ]; then
if [ "$SUPPORTS_HUP" = "yes" ]; then
echo reload
else
echo restart
fi
fi
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit

View File

@ -1,364 +0,0 @@
#! /bin/sh
# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany.
#
# Author: Peter Poeml <poeml@suse.de>, 2001
# Additions by Christof Hanke <biber@induhviduals.de>, 2009
#
# /etc/init.d/afs-server
# and its symbolic link
# /usr/sbin/rcafs-server
#
# System startup script for OpenAFS
#
### BEGIN INIT INFO
# Provides: afs-client
# Required-Start: $local_fs $named $network $remote_fs
# Should-Start: $syslog $time kdc afs-server
# Should-Stop: $null
# Required-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 2 1 6
# Short-Description: Start OpenAFS Client
# Description: Starts the OpenAFS Client by loading the required kernel-module and starting afsd.
### END INIT INFO
DAEMON="OpenAFS Client"
DAEMON_PIDFILE=
STARTPROC_LOGFILE=
SUPPORTS_HUP="no"
DAEMON_BIN=/usr/sbin/afsd.fuse
test -x $DAEMON_BIN || exit 5
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num><num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
. /etc/sysconfig/openafs-fuse-client
CACHEINFO=${CACHEINFO:-/etc/openafs/cacheinfo}
CACHE=${CACHEDIR:-/var/cache/openafs}
AFS=${AFSDIR:-/afs}
REGENERATE_CELL_INFO=${REGENERATE_CELL_INFO:-no}
REGENERATE_CACHE_INFO=${REGENERATE_CACHE_INFO:-yes}
MEMCACHE=${MEMCACHE:-yes}
VERBOSE=${VERBOSE:-no}
DYNROOT=${DYNROOT:-yes}
FAKESTAT=${FAKESTAT:-yes}
AFSDB=${AFSDB:-yes}
DATA_ENCRYPTION=${DATA_ENCRYPTION:-yes}
THIS_CELL_SERVER_NAME=${THIS_CELL_SERVER_NAME:-unknown}
SERVER_TIMEOUT=120
check_configfiles() {
if [ ! -f /etc/openafs/ThisCell ]; then
echo "Invalid configuration. Cellconfiguration in /etc/openafs/ThisCell is missing."
rc_failed 1
return
fi
if [ "$AFSDB" = "no" ] ; then
if [ ! -f /etc/openafs/CellServDB ]; then
echo "No CellServDB found and AFSDB=no."
echo "Either set AFSDB=yes in /etc/sysconfig/openafs [recommended] or"
echo "populate the /etc/openafs/CellServDB file"
rc_failed 1
return
fi
if [ "`grep -c \>$THIS_CELL /etc/openafs/CellServDB`" != "1" ] ; then
echo "Cannot find unique definition of your cell $THIS_CELL in /etc/openafs/CellServDB."
echo "Consider setting AFSDB=yes in /etc/sysconfig/openafs or"
echo "fix /etc/openafs/CellServDB."
rc_failed 1
fi
fi
}
generate_cellinfo() {
if [ "$REGENERATE_CELL_INFO" = "yes" -a "x$THIS_CELL" != "x" ]; then
rm -f /etc/openafs/ThisCell #it could be symlinks to server configuration
echo "$THIS_CELL" > /etc/openafs/ThisCell
if [ -f /etc/openafs/CellServDB -a ! -L /etc/openafs/CellServDB ]; then
if grep -q "^>$THIS_CELL\([[:space:]#].*\)\?$" /etc/openafs/CellServDB ; then
# CellServDB contains THIS_CELL, replace servers
awk "
/^>$THIS_CELL([[:space:]#].*)?$/ {
this_cell=1;
print \$0;
print \"$THIS_CELL_SERVER #$THIS_CELL_SERVER_NAME\";
next
}
/^>/ {
this_cell=0;
print \$0;
next
}
/^[^>[:space:]]+/ {
if (!this_cell) print \$0;
}
" /etc/openafs/CellServDB > /etc/openafs/CellServDB.new
else
# add THIS_CELL to CellServDB
echo ">$THIS_CELL #Cell name, generated from /etc/sysconfig/afs-client" >/etc/openafs/CellServDB.new
echo "$THIS_CELL_SERVER #$THIS_CELL_SERVER_NAME" >>/etc/openafs/CellServDB.new
cat /etc/openafs/CellServDB >> /etc/openafs/CellServDB.new
fi
mv -f /etc/openafs/CellServDB.new /etc/openafs/CellServDB
else
# new CellServDB
rm -f /etc/openafs/CellServDB #it could be symlinks to server configuration
echo ">$THIS_CELL #Cell name, generated from /etc/sysconfig/afs-client" >/etc/openafs/CellServDB
echo "$THIS_CELL_SERVER #$THIS_CELL_SERVER_NAME" >>/etc/openafs/CellServDB
fi
fi
}
generate_cacheinfo() {
if [ "$REGENERATE_CACHE_INFO" = "yes" -a "x$CACHESIZE" != "x" ]; then
if [ "$CACHESIZE" = "AUTOMATIC" ]; then
if [ "$MEMCACHE" = "yes" ]; then
useCACHESIZE=`awk '/^MemTotal:/{ print int($2 / 8);}' /proc/meminfo`
else
LINE=`df -k $CACHE | tail -1`
PART=`echo $LINE | awk '{ if ( ($NF != "/usr") && ($NF != "/") && ($NF != "/var") ) print $NF; else print "NONE";}'`
if [ "$PART" = "NONE" ]; then
echo "$CACHE is not a separate partition"
echo "you have to change the cachesize in $SYSCNF by hand"
return 1
else
PARTSIZE=`echo $LINE | awk '{print $2}'`
useCACHESIZE=`echo $PARTSIZE | awk '{printf "%d",int(($1*.8)/1024)*1024}'`
fi
fi
else
useCACHESIZE=$CACHESIZE
fi
echo $AFS:$CACHE:$useCACHESIZE >$CACHEINFO
chmod 0644 $CACHEINFO
mkdir -p $CACHE # to be sure
else
useCACHESIZE=`awk -F: '{print $3}' < $CACHEINFO`
fi
return 0
}
choose_afsdoptions() {
if [ "x$OPTIONS" = "x" -o "x$OPTIONS" = "xAUTOMATIC" ]; then
if [ $useCACHESIZE -lt 131072 ]; then
OPTIONS=$SMALL
elif [ $useCACHESIZE -lt 524288 ]; then
OPTIONS=$MEDIUM
elif [ $useCACHESIZE -lt 1048576 ]; then
OPTIONS=$LARGE
elif [ $useCACHESIZE -lt 2097152 ]; then
OPTIONS=$XLARGE
else
OPTIONS=$XXLARGE
fi
fi
AFSD_OPTIONS="$OPTIONS"
if [ "$MEMCACHE" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -memcache"
if [ "x$OPTIONS" != "x" -a "x$CACHESIZE" != "xAUTOMATIC" ];then
AFSD_OPTIONS="$AFSD_OPTIONS -blocks $useCACHESIZE"
fi
fi
if [ "$VERBOSE" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -verbose"
fi
if [ "$DYNROOT" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -dynroot"
fi
if [ "$FAKESTAT" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -fakestat"
fi
if [ "$AFSDB" = "yes" ]; then
AFSD_OPTIONS="$AFSD_OPTIONS -afsdb"
fi
}
killafs() {
SIGNAL=$1
PIDS=`lsof -Fp $AFS | sed -e 's/p//'`
if [ "x" != "x$PIDS" ]; then
kill -$SIGNAL $PIDS >/dev/null 2>&1
sleep 3
fi
}
wait_for_server() {
TIMEOUT=$SERVER_TIMEOUT
if [ -f /usr/sbin/bosserver ] && checkproc /usr/sbin/bosserver ; then
# we run on the same machine as the server
while /usr/sbin/bos status localhost -localauth |grep -q "salvaging file system"; do
echo
echo -n "Waiting for local AFS server to come up ..."
sleep 1
TIMEOUT=$(( $TIMEOUT - 1 ))
[ $TIMEOUT -eq 0 ] && return 1
done
fi
return 0
}
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
case "$1" in
start)
echo "Starting $DAEMON "
mkdir -p $AFS
if generate_cacheinfo; then
generate_cellinfo
check_configfiles
choose_afsdoptions
if wait_for_server; then
ps ax | grep -q '\[afsd\]' || $DAEMON_BIN $AFSD_OPTIONS || rc_failed 1
if [ "$DATA_ENCRYPTION" = "yes" ]; then
/usr/bin/fs setcrypt on
fi
if [ "x$SYSNAME" != "x" ]; then
/usr/bin/fs sysname $SYSNAME
fi
else
#local server not running
rc_failed 1
fi
else
rc_failed 6
fi
# Remember status and be verbose
rc_status -v
;;
stop)
[ "x`whoami`" = xroot ] || exit 4 # do not allow regular user to kill all his processes
echo -n "Shutting down $DAEMON "
if ps ax | grep -q '\[afsd\]'; then
echo
echo "Sending all processes using $AFS the TERM signal ..."
killafs TERM
echo "Sending all processes using $AFS the KILL signal ..."
killafs KILL
umount $AFS
fi
if grep -q ^$AFS_KERNEL_MODULE /proc/modules ; then
/sbin/rmmod $AFS_KERNEL_MODULE || rc_failed 1
fi
# rmtsys doesn't go away, so kill them all to be sure
killall $DAEMON_BIN > /dev/null 2>&1
# Remember status and be verbose
rc_status -v
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
$0 stop && $0 start
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
## If it does not support it, restart.
echo -n "Reload service $DAEMON"
if [ "$SUPPORTS_HUP" = "yes" ] ; then
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
#touch $DAEMON_PIDFILE
rc_status -v
else
$0 stop && $0 start
rc_status
fi
;;
reload)
## Like force-reload, but if daemon does not support
## signalling, do nothing (!)
if [ "$SUPPORTS_HUP" = "yes" ] ; then
# If it supports signalling:
echo -n "Reload service $DAEMON"
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
#touch $DAEMON_PIDFILE
rc_status -v
else
## Otherwise if it does not support reload:
rc_failed 3
rc_status -v
fi
;;
status)
echo -n "Checking for $DAEMON: "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
ps ax | grep -q '\[afsd\]' || rc_failed 3
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload,
## give out the argument which is required for a reload.
if [ "$DAEMON_CONF" -nt "$DAEMON_PIDFILE" ]; then
if [ "$SUPPORTS_HUP" = "yes" ]; then
echo reload
else
echo restart
fi
fi
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit

View File

@ -1,228 +0,0 @@
#! /bin/sh
# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany.
#
# Author: Peter Poeml <poeml@suse.de>, 2001
# Additions by Christof Hanke <biber@induhviduals.de>, 2009
#
# /etc/init.d/afs-server
# and its symbolic link
# /usr/sbin/rcafs-server
#
# System startup script for OpenAFS
#
### BEGIN INIT INFO
# Provides: afs-server
# Required-Start: $local_fs
# Should-Start: $syslog $time $network
# Should-Stop: $null
# Required-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 2 1 6
# Short-Description: Start OpenAFS Server
# Description: Start OpenAFS Server. Basically just starts the bosserver which manages the rest.
### END INIT INFO
DAEMON="OpenAFS Server"
DAEMON_PIDFILE=
STARTPROC_LOGFILE=
SUPPORTS_HUP="no"
DAEMON_BIN=/usr/sbin/bosserver
if [ `uname -p` = "x86_64" ]; then
LIBDIR=lib64
else
LIBDIR=lib
fi
VLSERVER_BIN=/usr/$LIBDIR/openafs/vlserver
PTSERVER_BIN=/usr/$LIBDIR/openafs/ptserver
FSSERVER_BIN=/usr/$LIBDIR/openafs/fileserver
VOLSERVER_BIN=/usr/$LIBDIR/openafs/volserver
SALVAGER_BIN=/usr/$LIBDIR/openafs/salvager
BOSCONFIG_FILE="/etc/openafs/server/BosConfig"
#test -x $DAEMON_BIN || exit 5
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num><num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
. /etc/sysconfig/openafs-server
REQUIRE_NETINFO=${REQUIRE_NETINFO=:-yes}
REGENERATE_BOS_CONFIG=${REGENERATE_BOS_CONFIG==:-no}
START_DB_SERVERS=${START_DB_SERVERS=:-no}
START_FILESERVER=${START_FILESERVER=:-no}
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
# set ulimit for core files
ulimit -c 1000000
case "$1" in
start)
if [ "$REQUIRE_NETINFO" = "yes" ]; then
if [ ! -e /var/lib/openafs/NetInfo ]; then
echo -n "Not starting $DAEMON, because no Server-NetInfo file present."
echo -n "Create this file under /var/lib/openafs/NetInfo or disable this"
echo -n "check in /etc/sysconfig/openafs-server"
rc_failed 1
rc_exit
fi
fi
if [ "$REGENERATE_BOS_CONFIG" = "yes" ]; then
echo -n Regenerating BosConfig-file
# save old BosConfig
mv $BOSCONFIG_FILE $BOSCONFIG_FILE.initsave
if [ "$BOSSERVER_RESTRICTED"= "yes" ]; then
echo restrictmode 1 > $BOSCONFIG_FILE
else
echo restrictmode 0 > $BOSCONFIG_FILE
fi
if [ "$BOSSERVER_RESTART_TIME" != "" ]; then
echo "$BOSSERVER_RESTART_TIME" >> $BOSCONFIG_FILE
else
echo "never" >> $BOSCONFIG_FILE
fi
if [ "$BOSSERVER_RESTART_FOR_NEWBINARIES_TIME" != "" ]; then
echo "$BOSSERVER_RESTART_FOR_NEWBINARIES_TIME" >> $BOSCONFIG_FILE
else
echo "never" >> $BOSCONFIG_FILE
fi
if [ "$START_DB_SERVERS" = "yes" ]; then
echo "bnode simple vlserver 1" >> $BOSCONFIG_FILE
echo "parm $VLSERVER_BIN $VLSERVER_OPTIONS" >> $BOSCONFIG_FILE
echo "end" >> $BOSCONFIG_FILE
echo "bnode simple ptserver 1" >> $BOSCONFIG_FILE
echo "parm $PTSERVER_BIN $PTSERVER_OPTIONS" >> $BOSCONFIG_FILE
echo "end" >> $BOSCONFIG_FILE
fi
if [ "$START_FILE_SERVERS" = "yes" ]; then
echo "bnode fs fs 1" >> $BOSCONFIG_FILE
echo "parm $FSSERVER_BIN $FSSERVER_OPTIONS" >> $BOSCONFIG_FILE
echo "parm $VOLSERVER_BIN $VOLSERVER_OPTIONS" >> $BOSCONFIG_FILE
echo "parm $SALVAGER_BIN $SALVAGER_OPTIONS" >> $BOSCONFIG_FILE
echo "end" >> $BOSCONFIG_FILE
fi
fi
echo -n "Starting $DAEMON"
startproc $DAEMON_BIN $BOSSERVER_OPTIONS
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down $DAEMON"
checkproc $DAEMON_BIN && /usr/sbin/bos shutdown localhost -localauth -wait
killproc -HUP $DAEMON_BIN
# Remember status and be verbose
rc_status -v
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
$0 stop && $0 start
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
## If it does not support it, restart.
echo -n "Reload service $DAEMON"
if [ "$SUPPORTS_HUP" = "yes" ] ; then
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
#touch $DAEMON_PIDFILE
rc_status -v
else
$0 stop && $0 start
rc_status
fi
;;
reload)
## Like force-reload, but if daemon does not support
## signalling, do nothing (!)
if [ "$SUPPORTS_HUP" = "yes" ] ; then
# If it supports signalling:
echo -n "Reload service $DAEMON"
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
#touch $DAEMON_PIDFILE
rc_status -v
else
## Otherwise if it does not support reload:
rc_failed 3
rc_status -v
fi
;;
status)
echo -n "Checking for $DAEMON: "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
checkproc $DAEMON_BIN
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload,
## give out the argument which is required for a reload.
if [ "$DAEMON_CONF" -nt "$DAEMON_PIDFILE" ]; then
if [ "$SUPPORTS_HUP" = "yes" ]; then
echo reload
else
echo restart
fi
fi
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit