Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:ARM
mcstrans
mcstrans-0.3.1-initscript.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mcstrans-0.3.1-initscript.patch of Package mcstrans
Index: src/mcstrans.init =================================================================== --- src/mcstrans.init.orig +++ src/mcstrans.init @@ -1,12 +1,7 @@ -#!/bin/bash -# -# mcstransd This starts and stops mcstransd -# -# chkconfig: - 08 87 -# description: This starts the SELinux Context Translation System Daemon +#!/bin/sh # # processname: /sbin/mcstransd -# pidfile: /var/run/mcstransd.pid +# pidfile: /var/run/mcstransd.pid # # Return values according to LSB for all commands but status: # 0 - success @@ -17,63 +12,74 @@ # 5 - program is not installed # 6 - program is not configured # 7 - program is not running +# +### BEGIN INIT INFO +# Provides: mcstrans +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Should-Start: +# Should-Stop: +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: This starts and stops mcstransd +# Description: This starts the SELinux Context Translation System Daemon +### END INIT INFO +# PATH=/sbin:/bin:/usr/bin:/usr/sbin +LOCK_FILE=/var/lock/subsys/mcstrans +SETRANS_DIR=/var/run/setrans prog="mcstransd" # Source function library. -. /etc/init.d/functions +. /etc/rc.status + +rc_reset # Allow anyone to run status if [ "$1" = "status" ] ; then - status $prog - RETVAL=$? - exit $RETVAL + echo -n $"Checking for $prog: " + checkproc -p $LOCK_FILE $prog + rc_status -v + rc_exit fi # Check that we are root ... so non-root users stop here -test $EUID = 0 || exit 4 +if [ $EUID -ne 0 ] ; then + echo $"Access denied. Only root can run this daemon" + rc_failed 4 + rc_status -v + rc_exit +fi -# If selinux is not enabled, return success -test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled || exit 0 +# Check whether SELinux is enabled +if [ ! -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled ; then + echo $"SELinux should be enabled to run this daemon" + rc_failed 1 + rc_status -v + rc_exit +fi -RETVAL=0 +mkdir -p $SETRANS_DIR start(){ 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 - if test $RETVAL = 0 ; then - touch /var/lock/subsys/mcstrans - fi - return $RETVAL + startproc -p $LOCK_FILE $prog "$EXTRAOPTIONS" + rc_status -v } stop(){ echo -n $"Stopping $prog: " - killproc $prog - RETVAL=$? - echo - rm -f /var/lock/subsys/mcstrans - return $RETVAL + killproc -p $LOCK_FILE -TERM $prog + rc_status -v } reload(){ - echo -n $"Reloading configuration: " - killproc $prog -HUP - RETVAL=$? - echo - return $RETVAL + echo -n $"Reloading configuration of $prog: " + killproc -HUP $prog + rc_status -v } restart(){ @@ -82,31 +88,30 @@ restart(){ } condrestart(){ - [ -e /var/lock/subsys/mcstrans ] && restart - return 0 + [ -e $LOCK_FILE ] && restart || : } - # See how we were called. case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload) - reload - ;; condrestart) condrestart ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|rotate}" - RETVAL=3 + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" + rc_failed 3 + rc_status -v esac -exit $RETVAL +rc_exit
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor