diff options
author | Jason Zaman <perfinion@gentoo.org> | 2017-04-27 02:08:38 +0800 |
---|---|---|
committer | Jason Zaman <perfinion@gentoo.org> | 2017-04-27 02:14:17 +0800 |
commit | e23657020be7d689d84a7d1d1a7a82a7b0155773 (patch) | |
tree | b4e3e1fce77e2691e38a51fe5b6fb9f52246e164 /sys-apps/restorecond/files | |
parent | sys-apps/mcstrans: New Package split from policycoreutils (diff) | |
download | gentoo-e23657020be7d689d84a7d1d1a7a82a7b0155773.tar.gz gentoo-e23657020be7d689d84a7d1d1a7a82a7b0155773.tar.bz2 gentoo-e23657020be7d689d84a7d1d1a7a82a7b0155773.zip |
sys-apps/restorecond: New Package split from policycoreutils
Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'sys-apps/restorecond/files')
-rwxr-xr-x | sys-apps/restorecond/files/restorecond.init | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys-apps/restorecond/files/restorecond.init b/sys-apps/restorecond/files/restorecond.init new file mode 100755 index 000000000000..709f1d1b9ece --- /dev/null +++ b/sys-apps/restorecond/files/restorecond.init @@ -0,0 +1,30 @@ +#!/sbin/openrc-run +# Copyright 2006-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +is_selinux_enabled() { + local SE_ENABL="/usr/sbin/selinuxenabled" + + if [ -x "$SE_ENABL" ]; then + $SE_ENABL && return 0 || return 1 + else + ewarn "Restorecond: Unable to determine SELinux status" + return 1 + fi +} + +start() { + if is_selinux_enabled; then + ebegin "Starting restorecond" + start-stop-daemon --start --quiet --exec /usr/sbin/restorecond + eend $? + fi +} + +stop() { + if is_selinux_enabled; then + ebegin "Stopping restorecond" + start-stop-daemon --stop --quiet --pidfile /var/run/restorecond.pid + eend $? + fi +} |