summaryrefslogtreecommitdiffstats
path: root/test/units/autorelabel.service
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/units/autorelabel.service18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/units/autorelabel.service b/test/units/autorelabel.service
new file mode 100644
index 0000000..cb38849
--- /dev/null
+++ b/test/units/autorelabel.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=Relabel all filesystems
+DefaultDependencies=no
+Requires=local-fs.target
+Conflicts=shutdown.target
+After=local-fs.target
+Before=sysinit.target shutdown.target
+ConditionSecurity=selinux
+ConditionPathExists=|/.autorelabel
+
+[Service]
+ExecStart=sh -x -c 'echo 0 >/sys/fs/selinux/enforce && fixfiles -f -F relabel && rm /.autorelabel && systemctl --force reboot'
+Type=oneshot
+TimeoutSec=0
+RemainAfterExit=yes
+
+[Install]
+WantedBy=basic.target