[isdn4k-utils] - bz#545469, put vboxgetty config file in correct directory - fix wrong exit status in startup scrri

Than Ngo than at fedoraproject.org
Mon Sep 20 13:39:16 UTC 2010


commit 8886e3dabacfff4e42571846f0d067c31c5db6a3
Author: Than Ngo <than at redhat.com>
Date:   Mon Sep 20 15:37:51 2010 +0200

    - bz#545469, put vboxgetty config file in correct directory
    - fix wrong exit status in startup scrripts

 capi.init                                          |   36 ++++++--------
 isdn.init                                          |   50 +++++++++----------
 ...s-CVS-2010-05-01-patched-vboxgetty-config.patch |   12 +++++
 isdn4k-utils.spec                                  |   12 +++--
 4 files changed, 60 insertions(+), 50 deletions(-)
---
diff --git a/capi.init b/capi.init
index d51b49b..3fdc006 100755
--- a/capi.init
+++ b/capi.init
@@ -1,28 +1,24 @@
 #! /bin/bash
 #
 # chkconfig: 2345 9 91
-# description: start and stop capi services for passive ISDN cards
+# description: start and stop capi services for passiv ISDN cards
 #
 
 PATH=/bin:/sbin:/usr/bin:/usr/sbin
 
 # Source function library.
-if [ -f /etc/init.d/functions ]; then
-    . /etc/init.d/functions
-elif [ -f /etc/rc.d/init.d/functions ] ; then
-    . /etc/rc.d/init.d/functions
-else
-    exit 0
-fi
+. /etc/rc.d/init.d/functions
+
+# Check that we're a privileged user
+[ `id -u` = 0 ] || exit 4
+
+[ -x /sbin/capiinit ] || exit 5
+[ -f /etc/capi.conf ] || exit 6
 
-[ -f /sbin/capiinit ] || exit 0
-[ -f /etc/capi.conf ] || exit 0
 RETVAL=0
 
 function start()
 {
-    # don't start again if it's already started
-    [ ! -f /var/lock/subsys/capi ] || exit 0
     action $"Starting capi4linux:" capiinit start
     RETVAL=$?
     if [ $RETVAL -eq 0 ] ; then
@@ -32,12 +28,10 @@ function start()
 
 function stop()
 {
-    if [ -f /var/lock/subsys/capi ] ; then
-       action $"Stopping capi4linux:" capiinit stop
-       RETVAL=$?
-       if [ $RETVAL -eq 0 ] ; then
-          rm -f /var/lock/subsys/capi
-       fi
+    action $"Stopping capi4linux:" capiinit stop
+    RETVAL=$?
+    if [ $RETVAL -eq 0 ] ; then
+       rm -f /var/lock/subsys/capi
     fi
 }
 
@@ -54,9 +48,11 @@ function condrestart()
     fi
 }
 
+
 function status()
 {
     capiinfo
+    RETVAL=$?
 }
 
 case "$1" in 
@@ -77,7 +73,7 @@ case "$1" in
        ;;
     *)
        echo $"Usage: $0 {start|stop|restart|status|condrestart}"
-       exit 1
+       RETVAL=3
 esac
 
-exit 0
+exit $RETVAL
diff --git a/isdn.init b/isdn.init
index d59e9d0..6ea2a69 100755
--- a/isdn.init
+++ b/isdn.init
@@ -6,19 +6,19 @@
 
 PATH=/bin:/sbin:/usr/bin:/usr/sbin
 
-if [ -f /etc/init.d/functions ]; then
-    . /etc/init.d/functions
-elif [ -f /etc/rc.d/init.d/functions ] ; then
-    . /etc/rc.d/init.d/functions
-else
-    exit 0
-fi
+# Check that we're a privileged user
+[ `id -u` = 0 ] || exit 4
+
+[ -x /sbin/isdnctrl ] || exit 5
+
+# source function library
+. /etc/init.d/functions
 
-test -f /etc/sysconfig/isdncard || exit 0
+test -f /etc/sysconfig/isdncard || exit 6
 . /etc/sysconfig/isdncard
 
 if [ -z "$MODULE" -o -z "$RESOURCES" ]; then
-    exit 0
+    exit 6
 fi        
 
 # disable debug as default
@@ -118,7 +118,9 @@ function load_modules()
     [ "$PCMCIA" = "no" ] || return
 
     modprobe $MODULE $RESOURCES > /dev/null 2>&1
-    if [ $? = 0 ] ; then
+    isdnctrl list all >/dev/null 2>&1
+    RETVAL=$?
+    if [ $RETVAL -eq 0 ] ; then
         action $"Loading ISDN modules" /bin/true
         touch /var/lock/subsys/isdn
     else
@@ -145,7 +147,8 @@ function load_firmware()
     # loading firmware
     if [ -n "$FIRMWARE" ] ; then
         $FIRMWARE >/dev/null 2>&1
-        if [ $? -eq 0 ]; then
+        RETVAL=$?
+        if [ $RETVAL -eq 0 ]; then
             action $"Loading Firmware" /bin/true
         else
             action $"Loading Firmware" /bin/false
@@ -174,7 +177,8 @@ function start_isdnlog()
     else
         daemon /sbin/isdnlog /dev/isdnctrl0 -x0x3fff -M -w2 -S -D -s -O+/var/log/isdnctrl
     fi
-    if [ $? -eq 0 ] ; then
+    RETVAL=$?
+    if [ $RETVAL -eq 0 ] ; then
         action  $"Starting $prog" /bin/true
         touch /var/lock/subsys/isdnlog
     else
@@ -184,14 +188,12 @@ function start_isdnlog()
 
 function stop_isdnlog()
 {
-    if [ -f /var/lock/subsys/isdnlog ] ; then
-        prog="isdnlog"
-        echo -n $"Shutting down $prog"
-        killproc isdnlog
-        RETVAL=$?
-        echo
-        [ $RETVAL -eq 0 ] && /bin/rm -f /var/lock/subsys/isdnlog
-    fi
+    prog="isdnlog"
+    echo -n $"Shutting down $prog"
+    killproc isdnlog
+    RETVAL=$?
+    echo
+    [ $RETVAL -eq 0 ] && /bin/rm -f /var/lock/subsys/isdnlog
 }
 
 function makedev()
@@ -211,11 +213,7 @@ function start()
     # activate ISA PnP
     isapnp activate
 
-    # don't start again if it's already started
-    [ ! -f /var/lock/subsys/isdn ] || exit 0
-
     # load modules
-    remove_modules
     load_modules
  
     # load firmware and setup isdn device driver
@@ -279,7 +277,7 @@ case "$1" in
        ;;
     *)
        echo $"Usage: $0 {start|stop|restart|status|condrestart}"
-       exit 1
+       RETVAL=3
 esac
 
-exit 0
+exit $RETVAL
diff --git a/isdn4k-utils-CVS-2010-05-01-patched-vboxgetty-config.patch b/isdn4k-utils-CVS-2010-05-01-patched-vboxgetty-config.patch
new file mode 100644
index 0000000..9d9f8d0
--- /dev/null
+++ b/isdn4k-utils-CVS-2010-05-01-patched-vboxgetty-config.patch
@@ -0,0 +1,12 @@
+diff -up isdn4k-utils-CVS-2010-05-01-patched/vbox/Makefile.in.me isdn4k-utils-CVS-2010-05-01-patched/vbox/Makefile.in
+--- isdn4k-utils-CVS-2010-05-01-patched/vbox/Makefile.in.me	2010-09-20 14:55:42.000000000 +0200
++++ isdn4k-utils-CVS-2010-05-01-patched/vbox/Makefile.in	2010-09-20 14:56:22.000000000 +0200
+@@ -81,7 +81,7 @@ exec_prefix	= @exec_prefix@
+ mandir		= @CONFIG_MANDIR@
+ bindir		= @CONFIG_BINDIR@
+ sbindir		= /usr/sbin
+-sysconfdir	= /etc/vbox
++sysconfdir	= /etc/isdn
+ 
+ LOGFILEDIR	= @VBOX_LOGDIR@
+ PIDFILEDIR	= @VBOX_PIDDIR@
diff --git a/isdn4k-utils.spec b/isdn4k-utils.spec
index 3bf6b5d..2078a62 100644
--- a/isdn4k-utils.spec
+++ b/isdn4k-utils.spec
@@ -6,7 +6,7 @@
 Summary: Utilities for configuring an ISDN subsystem
 Name: isdn4k-utils
 Version: 3.2
-Release: 71%{?dist}
+Release: 72%{?dist}
 License: GPLv2+ and GPL+ and MIT and BSD and zlib
 Group: Applications/System
 Url: http://www.isdn4linux.de/
@@ -44,6 +44,7 @@ Patch18: isdn4k-utils-sh-linux.patch
 Patch19: isdn4k-utils-autoconf-2.6.4-quoting.patch
 Patch20: isdn4k-utils-CVS-2010-05-01-capi.patch
 Patch21: isdn4k-utils-CVS-2010-05-01-capi-soname.patch
+Patch22: isdn4k-utils-CVS-2010-05-01-patched-vboxgetty-config.patch
 
 Requires: udev >= 039-10.14.EL4
 Requires: hwdata >= 0.146.18.EL-1
@@ -144,6 +145,7 @@ popd
 %patch19 -p1 -b .quote
 %patch20 -p1 -b .capinew
 %patch21 -p1 -b .capi-soname
+%patch22 -p1 -b .vboxgetty-config
 
 # remove useless files
 find -type d -name "CVS" | xargs rm -rf
@@ -437,7 +439,6 @@ rm -rf %{buildroot}
 %files
 %defattr(-,root,root,755)
 %dir /etc/isdn
-%dir /etc/vbox
 %dir /var/spool/vbox
 %dir /var/log/vbox
 %dir %{_datadir}/isdn
@@ -447,8 +448,7 @@ rm -rf %{buildroot}
 %config(noreplace) /etc/ppp/peers/*
 %config(noreplace) /etc/capi.conf
 %config(noreplace) /etc/capi20.conf
-%config(noreplace) /etc/vbox/*.conf
-%if 0%{?fedora} > 13
+%if 0%{?fedora} > 13 || 0%{?rhel} > 6
 /lib/udev/rules.d/40-isdn.rules
 %endif
 %{_libdir}/pppd
@@ -540,6 +540,10 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Sep 20 2010 Than Ngo <than at redhat.com> - 3.2-72
+- bz#545469, put vboxgetty config file in correct directory
+- fix wrong exit status in startup scrripts
+
 * Fri May 14 2010 Than Ngo <than at redhat.com> - 3.2-71
 - fix bz#566909, thanks to Louis Lagendijk
     - own LIBDIR/capi


More information about the scm-commits mailing list