aboutsummaryrefslogtreecommitdiffstats
path: root/systemd
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-08-30 12:09:08 +0100
committerColin Guthrie <colin@mageia.org>2014-08-30 12:09:08 +0100
commitea427ad757e8b7c2c4bf7a2cd4176ebaefcbf3be (patch)
tree5913ccda5f0cf4e3e62fd2d0b070bef9b357a9b5 /systemd
parentf7d3fead844d504c88ef4bd2bd3b2a5d168cd1eb (diff)
parente2d575550ef975cb3cf5456060d75a66cd63aee4 (diff)
downloadinitscripts-ea427ad757e8b7c2c4bf7a2cd4176ebaefcbf3be.tar
initscripts-ea427ad757e8b7c2c4bf7a2cd4176ebaefcbf3be.tar.gz
initscripts-ea427ad757e8b7c2c4bf7a2cd4176ebaefcbf3be.tar.bz2
initscripts-ea427ad757e8b7c2c4bf7a2cd4176ebaefcbf3be.tar.xz
initscripts-ea427ad757e8b7c2c4bf7a2cd4176ebaefcbf3be.zip
Merge tag 'initscripts-9.55-1' into distro/mga
Tag as initscripts-9.55-1 Conflicts: Makefile lang.csh lang.sh po/Makefile ppp/ip-down ppp/ip-up rc.d/init.d/network service sysconfig.txt sysconfig/init sysconfig/network-scripts/ifdown-ppp sysconfig/network-scripts/ifup sysconfig/network-scripts/ifup-eth sysconfig/network-scripts/ifup-ippp sysconfig/network-scripts/ifup-ppp sysconfig/network-scripts/ifup-wireless sysconfig/network-scripts/network-functions sysctl.conf systemd/fedora-storage-init Notes: ppp support was dropped upstream so we will need to merge it into the ppp package as Fedora has done. The fedora-storage-init stuff has been dropped. LVM+Raid is typically initialised automatically now via udev rules etc. We should try and follow suit, but may need to add the legacy script back in for now.
Diffstat (limited to 'systemd')
-rwxr-xr-xsystemd/fedora-autorelabel3
-rwxr-xr-xsystemd/fedora-configure22
-rwxr-xr-xsystemd/fedora-domainname9
-rwxr-xr-xsystemd/fedora-readonly52
-rwxr-xr-xsystemd/fedora-storage-init41
-rw-r--r--systemd/system/fedora-configure.service15
-rw-r--r--systemd/system/fedora-domainname.service13
-rw-r--r--systemd/system/fedora-import-state.service2
-rw-r--r--systemd/system/fedora-readonly.service4
-rw-r--r--systemd/system/fedora-storage-init-late.service16
-rw-r--r--systemd/system/fedora-storage-init.service16
-rw-r--r--systemd/system/fedora-wait-storage.service18
12 files changed, 65 insertions, 146 deletions
diff --git a/systemd/fedora-autorelabel b/systemd/fedora-autorelabel
index 61dc5517..7cb9b40c 100755
--- a/systemd/fedora-autorelabel
+++ b/systemd/fedora-autorelabel
@@ -27,7 +27,8 @@ relabel_selinux() {
echo $"*** Relabeling could take a very long time, depending on file"
echo $"*** system size and speed of hard drives."
- /sbin/fixfiles -F restore > /dev/null 2>&1
+ FORCE=`cat /.autorelabel`
+ /sbin/fixfiles $FORCE restore > /dev/null 2>&1
fi
rm -f /.autorelabel
systemctl --force reboot
diff --git a/systemd/fedora-configure b/systemd/fedora-configure
deleted file mode 100755
index 43f17ca3..00000000
--- a/systemd/fedora-configure
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# Configure machine if necessary.
-
-. /etc/init.d/functions
-
-if [ -x /bin/plymouth ]; then
- /bin/plymouth quit
-fi
-
-if [ -x /usr/sbin/firstboot ]; then
- /usr/sbin/firstboot
-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}
-fi
diff --git a/systemd/fedora-domainname b/systemd/fedora-domainname
new file mode 100755
index 00000000..17f8ea8c
--- /dev/null
+++ b/systemd/fedora-domainname
@@ -0,0 +1,9 @@
+#!/usr/bin/bash
+. /etc/sysconfig/network
+
+if [ -n "${NISDOMAIN}" -a -x /usr/bin/domainname ]; then
+ domainname ${NISDOMAIN}
+ exit $?
+fi
+
+exit 0
diff --git a/systemd/fedora-readonly b/systemd/fedora-readonly
index 0690cd45..f33eef48 100755
--- a/systemd/fedora-readonly
+++ b/systemd/fedora-readonly
@@ -38,27 +38,33 @@ if strstr "$cmdline" noreadonlyroot ; then
READONLY=no
fi
+MOUNTS=()
if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
- mount_empty() {
- if [ -e "$1" ]; then
+ add_mount() {
+ mnt=${1%/}
+ MOUNTS=("${MOUNTS[@]}" "$mnt")
+ }
+
+ cp_empty() {
+ if [ -e "$1" ]; then
echo "$1" | cpio -p -vd "$RW_MOUNT" &>/dev/null
- mount -n --bind "$RW_MOUNT$1" "$1"
+ add_mount $1
fi
- }
+ }
- mount_dirs() {
+ cp_dirs() {
if [ -e "$1" ]; then
mkdir -p "$RW_MOUNT$1"
find "$1" -type d -print0 | cpio -p -0vd "$RW_MOUNT" &>/dev/null
- mount -n --bind "$RW_MOUNT$1" "$1"
+ add_mount $1
fi
}
- mount_files() {
+ cp_files() {
if [ -e "$1" ]; then
cp -a --parents "$1" "$RW_MOUNT"
- mount -n --bind "$RW_MOUNT$1" "$1"
+ add_mount $1
fi
}
@@ -83,24 +89,38 @@ if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
for file in /etc/rwtab /etc/rwtab.d/* /run/initramfs/rwtab ; do
is_ignored_file "$file" && continue
- [ -f $file ] && cat $file | while read type path ; do
+ [ -f $file ] && while read type path ; do
case "$type" in
empty)
- mount_empty $path
+ cp_empty $path
;;
files)
- mount_files $path
+ cp_files $path
;;
dirs)
- mount_dirs $path
+ cp_dirs $path
;;
*)
;;
esac
- selinux_fixup "$path"
- done
+ done < <(cat $file)
done
+ for m in "${MOUNTS[@]}"; do
+ prefix=0
+ for mount_point in "${MOUNTS[@]}"; do
+ [[ $m = $mount_point ]] && continue
+ if [[ $m =~ ^$mount_point/.* ]] ; then
+ prefix=1
+ break
+ fi
+ done
+ [[ $prefix -eq 1 ]] && continue
+
+ mount -n --bind "$RW_MOUNT$m" "$m"
+ selinux_fixup "$m"
+ done
+
# Use any state passed by initramfs
[ -d /run/initramfs/state ] && cp -a /run/initramfs/state/* $RW_MOUNT
@@ -170,4 +190,8 @@ if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
done
fi
fi
+
+ if mount | grep -q /var/lib/nfs/rpc_pipefs ; then
+ mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs
+ fi
fi
diff --git a/systemd/fedora-storage-init b/systemd/fedora-storage-init
deleted file mode 100755
index 962102af..00000000
--- a/systemd/fedora-storage-init
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-#
-# Storage initialization
-
-. /etc/init.d/functions
-
-[ -z "${cmdline}" ] && cmdline=$(cat /proc/cmdline)
-
-if ! strstr "$cmdline" nompath && [ -f /etc/multipath.conf ] && \
- [ -x /sbin/multipath ]; then
- modprobe dm-multipath > /dev/null 2>&1
- /sbin/multipath -u -v 0
- if [ -x /sbin/kpartx ]; then
- /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -u -a -p p" >/dev/null
- fi
-fi
-
-if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid ]; then
- modprobe dm-mirror >/dev/null 2>&1
- dmraidsets=$(LC_ALL=C /sbin/dmraid -s -c -i)
- if [ "$?" = "0" ]; then
- SAVEIFS=$IFS
- IFS=$(echo -en "\n\b")
- for dmname in $dmraidsets; do
- if [[ "$dmname" == isw_* ]] && \
- ! strstr "$cmdline" noiswmd; then
- continue
- fi
- /sbin/dmraid -ay -i --rm_partitions -p "$dmname" >/dev/null 2>&1
- /sbin/kpartx -u -a -p p "/dev/mapper/$dmname"
- done
- IFS=$SAVEIFS
- fi
-fi
-
-# Start any MD RAID arrays that haven't been started yet
-[ -r /proc/mdstat ] && [ -r /dev/.mdadm/map ] && /sbin/mdadm -IRs
-
-if [ -x /sbin/lvm ]; then
- action $"Setting up Logical Volume Management:" /sbin/lvm vgchange -a y --sysinit
-fi
diff --git a/systemd/system/fedora-configure.service b/systemd/system/fedora-configure.service
deleted file mode 100644
index 9564ae55..00000000
--- a/systemd/system/fedora-configure.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=Reconfigure the system on administrator request
-DefaultDependencies=no
-Conflicts=shutdown.target
-Before=multi-user.target shutdown.target
-After=local-fs.target
-ConditionPathExists=/.unconfigured
-
-[Service]
-ExecStart=/lib/systemd/fedora-configure
-ExecStopPost=/bin/rm -f /.unconfigured
-Type=oneshot
-TimeoutSec=0
-StandardInput=tty
-RemainAfterExit=yes
diff --git a/systemd/system/fedora-domainname.service b/systemd/system/fedora-domainname.service
new file mode 100644
index 00000000..d5e0ff54
--- /dev/null
+++ b/systemd/system/fedora-domainname.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Read and set NIS domainname from /etc/sysconfig/network
+Before=ypbind.service yppasswdd.service ypserv.service ypxfrd.service
+DefaultDependencies=no
+Conflicts=shutdown.target
+
+[Service]
+ExecStart=/lib/systemd/fedora-domainname
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/systemd/system/fedora-import-state.service b/systemd/system/fedora-import-state.service
index 00d3d066..7425fbaf 100644
--- a/systemd/system/fedora-import-state.service
+++ b/systemd/system/fedora-import-state.service
@@ -5,7 +5,7 @@ ConditionPathIsReadWrite=/
ConditionDirectoryNotEmpty=/run/initramfs/state
Conflicts=shutdown.target
Before=shutdown.target emergency.service emergency.target systemd-tmpfiles-setup.service
-After=remount-rootfs.service
+After=systemd-remount-fs.service
[Service]
ExecStart=/lib/systemd/fedora-import-state
diff --git a/systemd/system/fedora-readonly.service b/systemd/system/fedora-readonly.service
index 2a7db25f..680eace0 100644
--- a/systemd/system/fedora-readonly.service
+++ b/systemd/system/fedora-readonly.service
@@ -2,8 +2,8 @@
Description=Configure read-only root support
DefaultDependencies=no
Conflicts=shutdown.target
-Before=shutdown.target emergency.service emergency.target systemd-tmpfiles-setup.service local-fs.target
-After=remount-rootfs.service
+Before=shutdown.target emergency.service emergency.target systemd-tmpfiles-setup.service local-fs.target systemd-random-seed-load.service
+After=systemd-remount-fs.service
[Service]
ExecStart=/lib/systemd/fedora-readonly
diff --git a/systemd/system/fedora-storage-init-late.service b/systemd/system/fedora-storage-init-late.service
deleted file mode 100644
index 69ad0891..00000000
--- a/systemd/system/fedora-storage-init-late.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[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
-ConditionFileIsExecutable=|/sbin/lvm
-ConditionFileIsExecutable=|/sbin/dmraid
-ConditionPathExists=|/etc/multipath.conf
-
-[Service]
-ExecStart=/lib/systemd/fedora-storage-init
-Type=oneshot
-TimeoutSec=0
-RemainAfterExit=yes
diff --git a/systemd/system/fedora-storage-init.service b/systemd/system/fedora-storage-init.service
deleted file mode 100644
index 6d8e39ff..00000000
--- a/systemd/system/fedora-storage-init.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=Initialize storage subsystems (RAID, LVM, etc.)
-DefaultDependencies=no
-Conflicts=shutdown.target
-After=fedora-wait-storage.service
-Before=local-fs.target shutdown.target
-Wants=fedora-wait-storage.service
-ConditionFileIsExecutable=|/sbin/lvm
-ConditionFileIsExecutable=|/sbin/dmraid
-ConditionPathExists=|/etc/multipath.conf
-
-[Service]
-ExecStart=/lib/systemd/fedora-storage-init
-Type=oneshot
-TimeoutSec=0
-RemainAfterExit=yes
diff --git a/systemd/system/fedora-wait-storage.service b/systemd/system/fedora-wait-storage.service
deleted file mode 100644
index 9d3b6ae9..00000000
--- a/systemd/system/fedora-wait-storage.service
+++ /dev/null
@@ -1,18 +0,0 @@
-[Unit]
-Description=Wait for storage scan
-DefaultDependencies=no
-Conflicts=shutdown.target
-After=systemd-udev-settle.service
-Before=local-fs.target shutdown.target
-Wants=systemd-udev-settle.service
-
-[Service]
-ExecStart=-/sbin/rmmod scsi_wait_scan
-ExecStart=-/sbin/modprobe scsi_wait_scan
-ExecStart=-/sbin/rmmod scsi_wait_scan
-Type=oneshot
-TimeoutSec=0
-RemainAfterExit=yes
-StandardInput=null
-StandardOutput=null
-StandardError=null