summaryrefslogtreecommitdiff
path: root/sys-apps/restorecond/files/restorecond.init
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/restorecond/files/restorecond.init
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/restorecond/files/restorecond.init')
-rwxr-xr-xsys-apps/restorecond/files/restorecond.init30
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
+}