diff options
Diffstat (limited to 'systemd')
-rwxr-xr-x | systemd/fedora-autorelabel | 32 | ||||
-rwxr-xr-x | systemd/fedora-autoswap | 18 | ||||
-rwxr-xr-x | systemd/fedora-configure | 5 | ||||
-rwxr-xr-x | systemd/fedora-readonly | 6 | ||||
-rwxr-xr-x | systemd/fedora-storage-init | 8 | ||||
-rw-r--r-- | systemd/system/fedora-autorelabel-mark.service | 15 | ||||
-rw-r--r-- | systemd/system/fedora-autorelabel.service | 5 | ||||
-rw-r--r-- | systemd/system/fedora-autoswap.service | 12 | ||||
-rw-r--r-- | systemd/system/fedora-loadmodules.service | 4 | ||||
-rw-r--r-- | systemd/system/fedora-storage-init-late.service | 13 | ||||
-rw-r--r-- | systemd/system/fedora-sysinit-hack.service | 10 | ||||
-rw-r--r-- | systemd/system/fedora-sysinit-unhack.service | 11 |
12 files changed, 48 insertions, 91 deletions
diff --git a/systemd/fedora-autorelabel b/systemd/fedora-autorelabel index 326837b2..61dc5517 100755 --- a/systemd/fedora-autorelabel +++ b/systemd/fedora-autorelabel @@ -5,27 +5,13 @@ . /etc/init.d/functions -PLYMOUTH= -[ -x /usr/bin/plymouth ] && PLYMOUTH=yes - -# Check SELinux status -SELINUX_STATE= -if [ -e "/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then - if [ -r "/selinux/enforce" ] ; then - SELINUX_STATE=$(cat "/selinux/enforce") - else - # assume enforcing if you can't read it - SELINUX_STATE=1 - fi -fi - relabel_selinux() { # if /sbin/init is not labeled correctly this process is running in the # wrong context, so a reboot will be required after relabel AUTORELABEL= . /etc/selinux/config - echo "0" > /selinux/enforce - [ -n "$PLYMOUTH" ] && plymouth --hide-splash + echo "0" > /sys/fs/selinux/enforce + [ -x /bin/plymouth ] && plymouth --hide-splash if [ "$AUTORELABEL" = "0" ]; then echo @@ -47,16 +33,8 @@ relabel_selinux() { systemctl --force reboot } -[ -z "${cmdline}" ] && cmdline=$(cat /proc/cmdline) - # Check to see if a full relabel is needed -if [ -n "$SELINUX_STATE" -a "$READONLY" != "yes" ]; then - if strstr "$cmdline" autorelabel || [ -f /.autorelabel ] ; then - restorecon $(awk '!/^#/ && $4 !~ /noauto/ && $2 ~ /^\// { print $2 }' /etc/fstab) >/dev/null 2>&1 - relabel_selinux - fi -else - if [ "$READONLY" != "yes" ] && [ -d /etc/selinux ]; then - [ -f /.autorelabel ] || touch /.autorelabel - fi +if [ "$READONLY" != "yes" ]; then + restorecon $(awk '!/^#/ && $4 !~ /noauto/ && $2 ~ /^\// { print $2 }' /etc/fstab) >/dev/null 2>&1 + relabel_selinux fi diff --git a/systemd/fedora-autoswap b/systemd/fedora-autoswap deleted file mode 100755 index ea392909..00000000 --- a/systemd/fedora-autoswap +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# Support automatic swapon. -# - -. /etc/init.d/functions - -if [ "$AUTOSWAP" = "yes" ]; then - curswap=$(awk '/^\/dev/ { print $1 }' /proc/swaps | while read x; do get_numeric_dev dec $x ; echo -n " "; done) - swappartitions=$(blkid -t TYPE=swap -o device) - if [ x"$swappartitions" != x ]; then - for partition in $swappartitions ; do - [ ! -e $partition ] && continue - majmin=$(get_numeric_dev dec $partition) - echo $curswap | grep -qw "$majmin" || action $"Enabling local swap partitions: " swapon $partition - done - fi -fi diff --git a/systemd/fedora-configure b/systemd/fedora-configure index e6779fed..43f17ca3 100755 --- a/systemd/fedora-configure +++ b/systemd/fedora-configure @@ -4,8 +4,8 @@ . /etc/init.d/functions -if [ -x /usr/bin/plymouth ]; then - /usr/bin/plymouth quit +if [ -x /bin/plymouth ]; then + /bin/plymouth quit fi if [ -x /usr/sbin/firstboot ]; then @@ -15,6 +15,7 @@ fi # Reread in network configuration data. if [ -f /etc/sysconfig/network ]; then . /etc/sysconfig/network + [ -r /etc/hostname ] && HOSTNAME=$(cat /etc/hostname) # Reset the hostname. action $"Resetting hostname ${HOSTNAME}: " hostname ${HOSTNAME} diff --git a/systemd/fedora-readonly b/systemd/fedora-readonly index 70e57a62..4e8003a2 100755 --- a/systemd/fedora-readonly +++ b/systemd/fedora-readonly @@ -7,9 +7,9 @@ # Check SELinux status SELINUX_STATE= -if [ -e "/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then - if [ -r "/selinux/enforce" ] ; then - SELINUX_STATE=$(cat "/selinux/enforce") +if [ -e "/sys/fs/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then + if [ -r "/sys/fs/selinux/enforce" ] ; then + SELINUX_STATE=$(cat "/sys/fs/selinux/enforce") else # assume enforcing if you can't read it SELINUX_STATE=1 diff --git a/systemd/fedora-storage-init b/systemd/fedora-storage-init index b01a4657..66ba6a82 100755 --- a/systemd/fedora-storage-init +++ b/systemd/fedora-storage-init @@ -9,9 +9,9 @@ if ! strstr "$cmdline" nompath && [ -f /etc/multipath.conf ] && \ [ -x /sbin/multipath ]; then modprobe dm-multipath > /dev/null 2>&1 - /sbin/multipath -v 0 + /sbin/multipath -u -v 0 if [ -x /sbin/kpartx ]; then - /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p p" >/dev/null + /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -u -a -p p" >/dev/null fi fi @@ -25,13 +25,13 @@ if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid ]; then continue fi /sbin/dmraid -ay -i --rm_partitions -p "$dmname" >/dev/null 2>&1 - /sbin/kpartx -a -p p "/dev/mapper/$dmname" + /sbin/kpartx -u -a -p p "/dev/mapper/$dmname" done fi fi # Start any MD RAID arrays that haven't been started yet -[ -r /proc/mdstat -a -r /dev/md/md-device-map ] && /sbin/mdadm -IRs +[ -r /proc/mdstat ] && [ -r /dev/md/md-device-map ] && /sbin/mdadm -IRs if [ -x /sbin/lvm ]; then action $"Setting up Logical Volume Management:" /sbin/lvm vgchange -a y --sysinit diff --git a/systemd/system/fedora-autorelabel-mark.service b/systemd/system/fedora-autorelabel-mark.service new file mode 100644 index 00000000..33b5147b --- /dev/null +++ b/systemd/system/fedora-autorelabel-mark.service @@ -0,0 +1,15 @@ +[Unit] +Description=Mark the need to relabel after reboot +DefaultDependencies=no +Requires=local-fs.target +Conflicts=shutdown.target +After=local-fs.target +Before=sysinit.target shutdown.target +ConditionSecurity=!selinux +ConditionPathIsDirectory=/etc/selinux +ConditionPathExists=!/.autorelabel + +[Service] +ExecStart=-/bin/touch /.autorelabel +Type=oneshot +RemainAfterExit=yes diff --git a/systemd/system/fedora-autorelabel.service b/systemd/system/fedora-autorelabel.service index 10b37f69..c98a40ff 100644 --- a/systemd/system/fedora-autorelabel.service +++ b/systemd/system/fedora-autorelabel.service @@ -5,8 +5,9 @@ Requires=local-fs.target Conflicts=shutdown.target After=local-fs.target Before=sysinit.target shutdown.target -ConditionKernelCommandLine=autorelabel -ConditionPathExists=/.autorelabel +ConditionSecurity=selinux +ConditionKernelCommandLine=|autorelabel +ConditionPathExists=|/.autorelabel [Service] ExecStart=/lib/systemd/fedora-autorelabel diff --git a/systemd/system/fedora-autoswap.service b/systemd/system/fedora-autoswap.service deleted file mode 100644 index 21754c9c..00000000 --- a/systemd/system/fedora-autoswap.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Enable all detected swap partitions -DefaultDependencies=no -Conflicts=shutdown.target -After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target -Before=swap.target shutdown.target - -[Service] -ExecStart=/lib/systemd/fedora-autoswap -Type=oneshot -TimeoutSec=0 -RemainAfterExit=yes diff --git a/systemd/system/fedora-loadmodules.service b/systemd/system/fedora-loadmodules.service index 9b801258..cd2b4910 100644 --- a/systemd/system/fedora-loadmodules.service +++ b/systemd/system/fedora-loadmodules.service @@ -4,8 +4,8 @@ DefaultDependencies=no Conflicts=shutdown.target After=systemd-readahead-collect.service systemd-readahead-replay.service Before=sysinit.target shutdown.target -ConditionPathExists=/etc/rc.modules -ConditionDirectoryNotEmpty=/etc/sysconfig/modules/ +ConditionPathExists=|/etc/rc.modules +ConditionDirectoryNotEmpty=|/etc/sysconfig/modules/ [Service] ExecStart=/lib/systemd/fedora-loadmodules diff --git a/systemd/system/fedora-storage-init-late.service b/systemd/system/fedora-storage-init-late.service new file mode 100644 index 00000000..bfd4b73b --- /dev/null +++ b/systemd/system/fedora-storage-init-late.service @@ -0,0 +1,13 @@ +[Unit] +Description=Initialize storage subsystems (RAID, LVM, etc.) +DefaultDependencies=no +Conflicts=shutdown.target +After=cryptsetup.target fedora-storage-init.service +Before=local-fs.target shutdown.target +Wants=fedora-wait-storage.service + +[Service] +ExecStart=/lib/systemd/fedora-storage-init +Type=oneshot +TimeoutSec=0 +RemainAfterExit=yes diff --git a/systemd/system/fedora-sysinit-hack.service b/systemd/system/fedora-sysinit-hack.service deleted file mode 100644 index dd78da80..00000000 --- a/systemd/system/fedora-sysinit-hack.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Bootup hack -DefaultDependencies=no -Conflicts=shutdown.target -Before=basic.target shutdown.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/bin/touch /dev/.in_sysinit diff --git a/systemd/system/fedora-sysinit-unhack.service b/systemd/system/fedora-sysinit-unhack.service deleted file mode 100644 index 221d8bb1..00000000 --- a/systemd/system/fedora-sysinit-unhack.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Bootup unhack -DefaultDependencies=no -Conflicts=shutdown.target -Before=shutdown.target -After=fedora-sysinit-hack.service sysinit.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=-/bin/rm -f /dev/.in_sysinit |