/etc/init.d/mcstrans is in policycoreutils 2.1.0-3ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | #!/bin/bash
### BEGIN INIT INFO
# Provides: mcstransd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The daemon to make sensitivity labels human readable form
# Description: This daemon maps machine readable sensitivity labels
# (numbered levels and categories) to a human readable form
# (arbitrary names assigned by the sysadmin).
### END INIT INFO
#
# mcstransd This starts and stops mcstransd
#
# chkconfig: - 08 87
# description: This starts the SELinux Context Translation System Daemon
#
# processname: /sbin/mcstransd
#
# Return values according to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
PATH=/sbin:/bin:/usr/bin:/usr/sbin
prog="mcstransd"
lockfile=/var/lock/$prog
# Get lsb functions
. /lib/lsb/init-functions
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# 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 $EUID = 0 || exit 4
# If selinux is not enabled, return success
test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled || exit 0
RETVAL=0
start(){
test -x /sbin/mcstransd || exit 5
echo -n $"Starting $prog: "
if ! [ -d /var/run/setrans ]; then
rm -rf /var/run/setrans
install -d -o root -g root /var/run/setrans
fi
unset HOME MAIL USER USERNAME
start-stop-daemon --start --quiet --exec /sbin/mcstransd -- "$EXTRAOPTIONS"
RETVAL=$?
echo
if test $RETVAL = 0 ; then
touch $lockfile
fi
return $RETVAL
}
stop(){
echo -n $"Stopping $prog: "
killall $prog
RETVAL=$?
echo
rm -f $lockfile
return $RETVAL
}
restart(){
stop
start
}
condrestart(){
[ -e $lockfile ] && restart
return 0
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
restart
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|force-reload|condrestart}"
RETVAL=3
esac
exit $RETVAL
|