aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2007-11-26 23:58:44 +0000
committerReuben Thomas <rrt@sc3d.org>2007-11-26 23:58:44 +0000
commit80b344d9ec08f49e67d0c473fe2fcec0f6da1c8b (patch)
tree34461ba7ebaaf04bbd2774633650b31e6615e51d /etc
parent6abb8b99c63a1f4c91c37d57e8aab049e8b28c42 (diff)
downloadplptools-80b344d9ec08f49e67d0c473fe2fcec0f6da1c8b.tar.gz
plptools-80b344d9ec08f49e67d0c473fe2fcec0f6da1c8b.tar.bz2
plptools-80b344d9ec08f49e67d0c473fe2fcec0f6da1c8b.zip
Remove SuSE 7.3 init script and replace it with SuSE 8 init script
(the newest we had).
Diffstat (limited to 'etc')
-rwxr-xr-xetc/psion.SuSE.in144
-rwxr-xr-xetc/psion.SuSE8.in102
2 files changed, 64 insertions, 182 deletions
diff --git a/etc/psion.SuSE.in b/etc/psion.SuSE.in
index 6d24cd3..3c52cd6 100755
--- a/etc/psion.SuSE.in
+++ b/etc/psion.SuSE.in
@@ -1,118 +1,102 @@
-#! /bin/sh
+#!/bin/sh
#
-# /sbin/init.d/psion
-#
-
-. /etc/rc.config
-
-# Determine the base and follow a runlevel link name.
-base=${0##*/}
-link=${base#*[SK][0-9][0-9]}
-
-# Force execution if not called by a runlevel directory.
-test $link = $base && START_PSION=yes
-test "$START_PSION" = yes || exit 0
+### BEGIN INIT INFO
+# Provides: psion
+# Required-Start: $syslog
+# Required-Stop:
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Description: Start Psion support
+### END INIT INFO
-test -f @prefix@/sbin/ncpd || exit 0
-test -f @prefix@/sbin/plpnfsd || exit 0
-test -f @prefix@/sbin/plpprintd || exit 0
+# Source function library.
+. /etc/rc.status
-# The echo return value for success (defined in /etc/rc.config).
-showresult() {
- test $RETVAL -eq 0 && echo -e $rc_done || echo -e $rc_failed
-}
+[ -f @prefix@/sbin/ncpd ] || exit 0
+[ -f @prefix@/sbin/plpnfsd ] || exit 0
+[ -f @prefix@/sbin/plpprintd ] || exit 0
+[ -f /etc/sysconfig/psion ] || exit 0
+. /etc/sysconfig/psion
-showstatus() {
- ## Check status with checkproc(8), if process is running
- ## checkproc will return with exit status 0.
- checkproc @prefix@/sbin/$1 && \
- echo -n "$1 running " || \
- echo -n "No running $1 "
-}
+rc_reset
start() {
echo "Starting Psion support ..."
- RETVAL=0
- if test "$START_NCPD" = "yes" ; then
+ if [ "$START_NCPD" = "yes" ] ; then
echo -n " ncpd: "
- /sbin/startproc @prefix@/sbin/ncpd $NCPD_ARGS
- RETVAL=$?
- showresult
+ startproc -f @prefix@/sbin/ncpd $NCPD_ARGS
+ rc_status -v
fi
- if test "$START_PLPNFSD" = "yes" ; then
+ if [ "$START_PLPNFSD" = "yes" ] ; then
echo -n " plpnfsd: "
- /sbin/startproc @prefix@/sbin/plpnfsd $PLPNFSD_ARGS
- RETVAL=$?
- showresult
+ startproc -f @prefix@/sbin/plpnfsd $PLPNFSD_ARGS
+ rc_status -v
fi
- if test "$START_PLPPRINTD" = "yes" ; then
+ if [ "$START_PLPPRINTD" = "yes" ] ; then
echo -n " plpprintd: "
- /sbin/startproc @prefix@/sbin/plpprintd $PLPPRINTD_ARGS
- RETVAL=$?
- showresult
+ startproc -f @prefix@/sbin/plpprintd $PLPPRINTD_ARGS
+ rc_status -v
fi
- return $RETVAL
+ rc_status && touch /var/lock/subsys/psion
}
stop() {
echo "Stopping Psion support ..."
- if test "$START_PLPNFSD" = "yes" ; then
+ if [ "$START_PLPNFSD" = "yes" ] ; then
echo -n " plpnfsd: "
- /sbin/killproc -HUP plpnfsd
+ killproc -HUP @prefix@/sbin/plpnfsd
WAIT=5
while test $WAIT -gt 0 ; do
- test -z "`pidof plpnfsd`" && break;
+ test -z "`pidofproc plpnfsd`" && break;
sleep 1 # allow plpnfsd flushing it's cache
WAIT=`expr $WAIT - 1`
done
- test -z "`pidof plpnfsd`" || killproc plpnfsd
- RETVAL=$?
- showresult
+ test -z "`pidofproc plpnfsd`" || \
+ killproc -TERM @prefix@/sbin/plpnfsd
+ rc_status -v
fi
- if test "$START_PLPPRINTD" = "yes" ; then
+ if [ "$START_PLPPRINTD" = "yes" ] ; then
echo -n " plpprintd: "
- /sbin/killproc -TERM plpprintd
- RETVAL=$?
- showresult
+ killproc -TERM @prefix@/sbin/plpprintd
+ rc_status -v
fi
- if test "$START_NCPD" = "yes" ; then
+ if [ "$START_NCPD" = "yes" ] ; then
echo -n " ncpd: "
- /sbin/killproc -TERM ncpd
- RETVAL=$?
- showresult
+ killproc -TERM @prefix@/sbin/ncpd
+ rc_status -v
fi
- return $RETVAL
+ rc_status && rm -f /var/lock/subsys/psion
+}
+
+restart() {
+ stop
+ start
}
+# See how we were called.
case "$1" in
- start)
- start
+ start)
+ start
;;
-
- stop)
- stop
+ stop)
+ stop
;;
-
- reload|restart)
- ## If first returns OK call the second, if first or
- ## second command fails, set echo return value.
- $0 stop && $0 start || return=$rc_failed
+ status)
+ echo -n "Checking for service psion: "
+ checkproc @prefix@/sbin/plpnfsd && \
+ checkproc @prefix@/sbin/plpprintd && \
+ checkproc @prefix@/sbin/ncpd
+ rc_status -v
;;
-
- status)
- echo -n "Checking for Psion support: "
- showstatus ncpd
- showstatus plpnfsd
- showstatus plpprintd
+ restart|reload)
+ restart
;;
-
- *)
- echo "Usage: $0 {start|stop|status|restart}"
- exit 1
+ condrestart)
+ test -f /var/lock/subsys/psion && restart || :
;;
+ *)
+ echo "Usage: psion {start|stop|status|restart|reload|condrestart}"
+ exit 1
esac
-# Inform the caller not only verbosely and set an exit status.
-test "$return" = "$rc_done" || exit 1
-exit 0
-
+rc_exit
diff --git a/etc/psion.SuSE8.in b/etc/psion.SuSE8.in
deleted file mode 100755
index 3c52cd6..0000000
--- a/etc/psion.SuSE8.in
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/sh
-#
-### BEGIN INIT INFO
-# Provides: psion
-# Required-Start: $syslog
-# Required-Stop:
-# Default-Start: 3 5
-# Default-Stop: 0 1 2 6
-# Description: Start Psion support
-### END INIT INFO
-
-# Source function library.
-. /etc/rc.status
-
-[ -f @prefix@/sbin/ncpd ] || exit 0
-[ -f @prefix@/sbin/plpnfsd ] || exit 0
-[ -f @prefix@/sbin/plpprintd ] || exit 0
-[ -f /etc/sysconfig/psion ] || exit 0
-. /etc/sysconfig/psion
-
-rc_reset
-
-start() {
- echo "Starting Psion support ..."
- if [ "$START_NCPD" = "yes" ] ; then
- echo -n " ncpd: "
- startproc -f @prefix@/sbin/ncpd $NCPD_ARGS
- rc_status -v
- fi
- if [ "$START_PLPNFSD" = "yes" ] ; then
- echo -n " plpnfsd: "
- startproc -f @prefix@/sbin/plpnfsd $PLPNFSD_ARGS
- rc_status -v
- fi
- if [ "$START_PLPPRINTD" = "yes" ] ; then
- echo -n " plpprintd: "
- startproc -f @prefix@/sbin/plpprintd $PLPPRINTD_ARGS
- rc_status -v
- fi
- rc_status && touch /var/lock/subsys/psion
-}
-
-stop() {
- echo "Stopping Psion support ..."
- if [ "$START_PLPNFSD" = "yes" ] ; then
- echo -n " plpnfsd: "
- killproc -HUP @prefix@/sbin/plpnfsd
- WAIT=5
- while test $WAIT -gt 0 ; do
- test -z "`pidofproc plpnfsd`" && break;
- sleep 1 # allow plpnfsd flushing it's cache
- WAIT=`expr $WAIT - 1`
- done
- test -z "`pidofproc plpnfsd`" || \
- killproc -TERM @prefix@/sbin/plpnfsd
- rc_status -v
- fi
- if [ "$START_PLPPRINTD" = "yes" ] ; then
- echo -n " plpprintd: "
- killproc -TERM @prefix@/sbin/plpprintd
- rc_status -v
- fi
- if [ "$START_NCPD" = "yes" ] ; then
- echo -n " ncpd: "
- killproc -TERM @prefix@/sbin/ncpd
- rc_status -v
- fi
- rc_status && rm -f /var/lock/subsys/psion
-}
-
-restart() {
- stop
- start
-}
-
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- echo -n "Checking for service psion: "
- checkproc @prefix@/sbin/plpnfsd && \
- checkproc @prefix@/sbin/plpprintd && \
- checkproc @prefix@/sbin/ncpd
- rc_status -v
- ;;
- restart|reload)
- restart
- ;;
- condrestart)
- test -f /var/lock/subsys/psion && restart || :
- ;;
- *)
- echo "Usage: psion {start|stop|status|restart|reload|condrestart}"
- exit 1
-esac
-
-rc_exit