Blame | Last modification | View Log | RSS feed
#!/bin/sh## restorecond: Daemon used to maintain path file context## chkconfig: - 12 87# description: restorecond uses inotify to look for creation of new files \# listed in the /etc/selinux/restorecond.conf file, and restores the \# correct security context.## processname: /usr/sbin/restorecond# config: /etc/selinux/restorecond.conf# pidfile: /var/run/restorecond.pid## 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 runningPATH=/sbin:/bin:/usr/bin:/usr/sbin# Source function library.. /etc/rc.d/init.d/functions[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled || exit 7# Check that we are root ... so non-root users stop heretest $EUID = 0 || exit 4test -x /usr/sbin/restorecond || exit 5test -f /etc/selinux/restorecond.conf || exit 6RETVAL=0start(){echo -n $"Starting restorecond: "unset HOME MAIL USER USERNAMEdaemon /usr/sbin/restorecondRETVAL=$?touch /var/lock/subsys/restorecondechoreturn $RETVAL}stop(){echo -n $"Shutting down restorecond: "killproc restorecondRETVAL=$?rm -f /var/lock/subsys/restorecondechoreturn $RETVAL}restart(){stopstart}# See how we were called.case "$1" instart)start;;stop)stop;;status)status restorecondRETVAL=$?;;force-reload|restart|reload)restart;;condrestart)[ -e /var/lock/subsys/restorecond ] && restart || :;;*)echo $"Usage: $0 {start|stop|restart|reload|force-reload|status|condrestart}"RETVAL=3esacexit $RETVAL