aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2001-07-23 19:40:03 +0000
committerFritz Elfert <felfert@to.com>2001-07-23 19:40:03 +0000
commitf71ff766639368ae50b89858dee11bf2ff3f0061 (patch)
treeef5249366e78f0d828b0b20f1a80deffce5addd6
parent9d9530a14c61568ecbdb4addb80195646f4e0a7b (diff)
downloadplptools-f71ff766639368ae50b89858dee11bf2ff3f0061.tar.gz
plptools-f71ff766639368ae50b89858dee11bf2ff3f0061.tar.bz2
plptools-f71ff766639368ae50b89858dee11bf2ff3f0061.zip
Added SuSE-related install-stuff
-rw-r--r--Makefile.am22
-rw-r--r--etc/.cvsignore1
-rwxr-xr-xetc/psion.SuSE.in98
3 files changed, 121 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 1e3fb06..5775bc3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,6 +26,28 @@ maintainer-clean-local:
find . -name "\.\#*" -exec rm -f {} \;
sh conf/intlclean
+# Suse doesn't have chkconfig, so we need to create the symlinks here.
+install-data-local:
+ if [ -f /etc/SuSE-release ] ; then \
+ install -m 755 etc/psion.SuSE $(DESTDIR)/etc/rc.d/init.d/psion ;\
+ ln -s ../psion /etc/rc.d/rc2.d/S45psion ;\
+ ln -s ../psion /etc/rc.d/rc3.d/S45psion ;\
+ ln -s ../psion /etc/rc.d/rc4.d/S45psion ;\
+ ln -s ../psion /etc/rc.d/rc5.d/S45psion ;\
+ ln -s ../psion /etc/rc.d/rc1.d/K70psion ;\
+ ln -s ../psion /etc/rc.d/rc0.d/K70psion ;\
+ ln -s ../psion /etc/rc.d/rc6.d/K70psion ;\
+ grep -v START_PSION /etc/rc.config > /etc/rc.config.psion ;\
+ ( \
+ echo '# Set START_PSION to yes to start Psion support' ;\
+ echo 'START_PSION=yes' ;\
+ ) >> /etc/rc.config.psion ;\
+ cp /etc/rc.config /etc/rc.config.old ;\
+ mv /etc/rc.config.psion /etc/rc.config ;\
+ else \
+ install -m 755 etc/psion $(DESTDIR)/etc/rc.d/init.d/psion ;\
+ fi
+
dist-hook:
$(MAKE) TMPDEST=$(distdir)/ kdoc specfile
$(MAKE) -C $(distdir)/kde2 -f Makefile.am am_edit
diff --git a/etc/.cvsignore b/etc/.cvsignore
index 86114be..a7bfa17 100644
--- a/etc/.cvsignore
+++ b/etc/.cvsignore
@@ -1,2 +1,3 @@
psion
+psion.SuSE
plptools.spec
diff --git a/etc/psion.SuSE.in b/etc/psion.SuSE.in
new file mode 100755
index 0000000..0e7c504
--- /dev/null
+++ b/etc/psion.SuSE.in
@@ -0,0 +1,98 @@
+#! /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
+
+test -f @prefix@/sbin/ncpd || exit 0
+test -f @prefix@/sbin/plpnfsd || exit 0
+
+# The echo return value for success (defined in /etc/rc.config).
+return=$rc_done
+
+MGETTY_HASPLP=false
+
+if grep -qs ^/PLP/ /etc/mgetty+sendfax/login.config ; then
+ mrun=`pidofproc mgetty`
+ test -n "$mrun" && MGETTY_HASPLP=true
+fi
+
+start() {
+ if $MGETTY_HASPLP ; then
+ echo "NOT Starting ncpd because mgetty configured for PLP"
+ exit 0
+ fi
+ echo -n "Starting Psion support (ncpd): "
+ /sbin/startproc @prefix@/sbin/ncpd
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo -e "$return"
+ echo -n "Starting Psion support (plpnfsd): "
+ /sbin/startproc @prefix@/sbin/plpnfsd
+ RETVAL=$?
+ fi
+ test $RETVAL -eq 0 || return=$rc_failed
+ echo -e "$return"
+ return $RETVAL
+}
+
+stop() {
+ echo -n "Stopping Psion support: "
+ /bin/killproc -HUP plpnfsd
+ while true ; do
+ test -z "`pidof plpnfsd`" && break;
+ sleep 1 # allow plpnfsd flushing it's cache
+ done
+ /sbin/killproc -TERM ncpd
+ RETVAL=$?
+ test $RETVAL -eq 0 || return=$rc_failed
+ echo -e "$return"
+ return $RETVAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+
+ 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 Psion support: "
+ ## Check status with checkproc(8), if process is running
+ ## checkproc will return with exit status 0.
+ checkproc @prefix@/sbin/ncpd && \
+ echo -n "ncpd running " || \
+ echo -n "No running ncpd "
+ checkproc @prefix@/sbin/plpnfsd && \
+ echo -n "plpnfsd running " || \
+ echo -n "No running plpnfsd "
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|status|restart}"
+ exit 1
+ ;;
+esac
+
+# Inform the caller not only verbosely and set an exit status.
+test "$return" = "$rc_done" || exit 1
+exit 0
+