From 0568402099c762ee45db89fa46dae38238ea99ce Mon Sep 17 00:00:00 2001 From: Steve Conklin Date: Thu, 25 Oct 2007 21:12:22 +0000 Subject: [PATCH] Fixed the init script --- mcstrans-0.2.3-init.patch | 120 ++++++++++++++++++++++++++++++++++++++ mcstrans.spec | 7 ++- 2 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 mcstrans-0.2.3-init.patch diff --git a/mcstrans-0.2.3-init.patch b/mcstrans-0.2.3-init.patch new file mode 100644 index 0000000..cbe8ca4 --- /dev/null +++ b/mcstrans-0.2.3-init.patch @@ -0,0 +1,120 @@ +diff -ur mcstrans-0.2.3.orig/src/mcstrans.init mcstrans-0.2.3/src/mcstrans.init +--- mcstrans-0.2.3.orig/src/mcstrans.init 2007-08-24 09:17:43.000000000 -0400 ++++ mcstrans-0.2.3/src/mcstrans.init 2007-08-24 10:14:26.000000000 -0400 +@@ -19,65 +19,71 @@ + # 7 - program is not running + + PATH=/sbin:/bin:/usr/bin:/usr/sbin ++prog="mcstransd" + + # Source function library. + . /etc/init.d/functions + ++# Allow anyone to run status ++if [ "$1" = "status" ] ; then ++ status $prog ++ RETVAL=$? ++ exit $RETVAL ++fi ++ + # Check that we are root ... so non-root users stop here +-test `id -u` = 0 || exit 4 ++test $EUID = 0 || exit 4 + ++# If selinux is not enabled, return success + test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled || exit 0 + +-test -x /sbin/mcstransd || exit 5 +- + RETVAL=0 + +-prog="mcstransd" +- + start(){ +- echo -n $"Starting $prog: " +- if status $prog > /dev/null; then +- echo -n $"$prog: already running" +- failure ++ test -x /sbin/mcstransd || exit 5 ++ echo -n $"Starting $prog: " ++ if status $prog > /dev/null; then ++ echo -n $"$prog: already running" ++ failure ++ echo ++ return 1 ++ fi ++ ++ unset HOME MAIL USER USERNAME ++ daemon $prog "$EXTRAOPTIONS" ++ RETVAL=$? + echo +- return 1 +- fi +- +- unset HOME MAIL USER USERNAME +- daemon $prog "$EXTRAOPTIONS" +- RETVAL=$? +- echo +- if test $RETVAL = 0 ; then +- touch /var/lock/subsys/mcstrans +- fi +- return $RETVAL ++ if test $RETVAL = 0 ; then ++ touch /var/lock/subsys/mcstrans ++ fi ++ return $RETVAL + } + + stop(){ +- echo -n $"Stopping $prog: " +- killproc $prog +- RETVAL=$? +- echo +- rm -f /var/lock/subsys/mcstrans +- return $RETVAL ++ echo -n $"Stopping $prog: " ++ killproc $prog ++ RETVAL=$? ++ echo ++ rm -f /var/lock/subsys/mcstrans ++ return $RETVAL + } + + reload(){ +- echo -n $"Reloading configuration: " +- killproc $prog -HUP +- RETVAL=$? +- echo +- return $RETVAL ++ echo -n $"Reloading configuration: " ++ killproc $prog -HUP ++ RETVAL=$? ++ echo ++ return $RETVAL + } + + restart(){ +- stop +- start ++ stop ++ start + } + + condrestart(){ +- [ -e /var/lock/subsys/mcstrans ] && restart +- return 0 ++ [ -e /var/lock/subsys/mcstrans ] && restart ++ return 0 + } + + +@@ -89,9 +95,6 @@ + stop) + stop + ;; +- status) +- status $prog +- ;; + restart) + restart + ;; diff --git a/mcstrans.spec b/mcstrans.spec index b2e6ed9..2cbb1b7 100644 --- a/mcstrans.spec +++ b/mcstrans.spec @@ -1,10 +1,11 @@ Summary: SELinux Translation Daemon Name: mcstrans Version: 0.2.6 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL Group: System Environment/Daemons Source: http://fedora.redhat.com/projects/%{name}-%{version}.tgz +Patch0: mcstrans-0.2.3-init.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libselinux-devel >= 1.30.3-1 BuildRequires: libcap-devel @@ -30,6 +31,7 @@ from internal representations to user defined representation. %prep %setup -q +%patch0 -p1 %build make clean @@ -70,6 +72,9 @@ fi %{_sysconfdir}/rc.d/init.d/mcstrans %changelog +* Thu Oct 25 2007 Steve Conklin - 0.2.6-2 +- Fixed some init script errors + * Thu Sep 13 2007 Dan Walsh 0.2.6-1 - Check for max_categories and error out