packages: systemd/network.service, systemd/systemd.spec, systemd/pld-storag...

baggins baggins at pld-linux.org
Wed Mar 14 23:01:14 CET 2012


Author: baggins                      Date: Wed Mar 14 22:01:14 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 4
- separate network services seemed line a nice idea, but it makes impossible to
  restart enire network stack (SysV: service network restart) and it's RPITA
  to setup anything more than simple ethX ifaces
- add services and scripts to support LVM/RAID/etc (shameless rip from fedora)
- package wants dirs with missingok
- only setup basic services on first install

---- Files affected:
packages/systemd:
   network.service (1.3 -> 1.4) , systemd.spec (1.122 -> 1.123) , pld-storage-init-late.service (NONE -> 1.1)  (NEW), pld-storage-init.service (NONE -> 1.1)  (NEW), pld-storage-init.sh (NONE -> 1.1)  (NEW), pld-wait-storage.service (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/systemd/network.service
diff -u packages/systemd/network.service:1.3 packages/systemd/network.service:1.4
--- packages/systemd/network.service:1.3	Thu Jan 26 19:23:16 2012
+++ packages/systemd/network.service	Wed Mar 14 23:01:09 2012
@@ -7,8 +7,8 @@
 
 [Service]
 Type=oneshot
-ExecStart=/sbin/service network start_init
-ExecStop=/sbin/service network stop_deinit
+ExecStart=/sbin/service network start
+ExecStop=/sbin/service network stop
 RemainAfterExit=true
 
 [Install]

================================================================
Index: packages/systemd/systemd.spec
diff -u packages/systemd/systemd.spec:1.122 packages/systemd/systemd.spec:1.123
--- packages/systemd/systemd.spec:1.122	Fri Mar  2 22:27:32 2012
+++ packages/systemd/systemd.spec	Wed Mar 14 23:01:09 2012
@@ -18,18 +18,20 @@
 Summary(pl.UTF-8):	systemd - zarządca systemu i usług dla Linuksa
 Name:		systemd
 Version:	43
-Release:	3
+Release:	4
 License:	GPL v2+
 Group:		Base
 Source0:	http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.xz
 # Source0-md5:	446cc6db7625617af67e2d8e5f503a49
 Source1:	%{name}-sysv-convert
 Source2:	%{name}_booted.c
-Source3:	ifup at .service
-Source4:	network-post.service
 Source5:	network.service
 Source6:	compat-pld-media.tmpfiles
 Source7:	compat-pld-var-run.tmpfiles
+Source10:	pld-storage-init-late.service
+Source11:	pld-storage-init.service
+Source12:	pld-wait-storage.service
+Source13:	pld-storage-init.sh
 Patch0:		target-pld.patch
 Patch1:		config-pld.patch
 Patch2:		shut-sysv-up.patch
@@ -363,22 +365,30 @@
 ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/telinit
 
 ln -s ../modules $RPM_BUILD_ROOT%{_sysconfdir}/modules-load.d/modules.conf
-# disable random and console SYSV service
-ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/random.service
+
+# disable redundant SYSV services
+ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/allowlogin.service
 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/console.service
+ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/cpusets.service
+ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/killall.service
+ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/netfs.service
+ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/random.service
 
 # add static (non-NetworkManager) networking
-install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/ifup at .service
-install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/network-post.service
 install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/network.service
 
 # install compatibility tmpfiles configs
 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/compat-pld-media.conf
 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/compat-pld-var-run.conf
 
-# All wants links are created at %post to make sure they are not owned
-# and hence overriden by rpm if the user deletes them (missingok?)
-%{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system/*.target.wants
+# Install and enable storage subsystems support services (RAID, LVM, etc.)
+install %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/pld-storage-init-late.service
+install %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}/pld-storage-init.service
+install %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/pld-wait-storage.service
+install %{SOURCE13} $RPM_BUILD_ROOT/lib/systemd/pld-storage-init
+
+ln -s ../pld-storage-init-late.service $RPM_BUILD_ROOT%{systemdunitdir}/local-fs.target.wants/pld-storage-init-late.service
+ln -s ../pld-storage-init.service $RPM_BUILD_ROOT%{systemdunitdir}/local-fs.target.wants/pld-storage-init.service
 
 # it is in rc-scripts pkg
 %{__rm} $RPM_BUILD_ROOT%{systemdunitdir}/rc-local.service
@@ -442,49 +452,26 @@
 		echo $HOSTNAME > /etc/hostname
 		chmod 644 /etc/hostname
 	fi
+
+	# Enable the services we install by default.
+	/bin/systemctl enable \
+		getty at .service \
+		network.service \
+		remote-fs.target \
+		systemd-readahead-replay.service \
+		systemd-readahead-collect.service >/dev/null 2>&1 || :
 fi
-# Enable the services we install by default.
-/bin/systemctl enable \
-	getty at .service \
-	network.service \
-	network-post.service \
-	remote-fs.target \
-	systemd-readahead-replay.service \
-	systemd-readahead-collect.service >/dev/null 2>&1 || :
-
-# Find and enable all installed interfaces
-mkdir -p %{_sysconfdir}/systemd/system/network.target.wants >/dev/null 2>&1 || :
-for f in /etc/sysconfig/interfaces/ifcfg-* ; do
-	ff=$(basename $f)
-	ff=${ff##ifcfg-}
-	case "$ff" in
-	*.rpmorig|*.rpmnew|*.rpmsave|*~|*.orig)
-		continue
-		;;
-	*)
-		DEVICE="" ; ONBOOT="" ; USERS=""
-		. $f 2>/dev/null
-		[ ${USERS:-no} != no ] && continue
-		if [ "$DEVICE" = "$ff" -a ${ONBOOT:-no} = "yes" ]; then
-			ln -s %{systemdunitdir}/ifup at .service \
-				%{_sysconfdir}/systemd/system/network.target.wants/ifcfg@$ff.service >/dev/null 2>&1 || :
-		fi
-		;;
-	esac
-done
 
 %preun units
 if [ $1 -eq 0 ] ; then
 	/bin/systemctl disable \
 		getty at .service \
 		network.service \
-		network-post.service \
 		remote-fs.target \
 		systemd-readahead-replay.service \
 		systemd-readahead-collect.service >/dev/null 2>&1 || :
 
 	%{__rm} -f %{_sysconfdir}/systemd/system/default.target >/dev/null 2>&1 || :
-	%{__rm} -f %{_sysconfdir}/systemd/system/network.target.wants/ifcfg@*.service >/dev/null 2>&1 || :
 fi
 
 %postun units
@@ -492,6 +479,12 @@
 	/bin/systemctl daemon-reload > /dev/null 2>&1 || :
 fi
 
+%triggerpostun units -- %{name}-units < 43-4
+# Remove design fialures
+/bin/systemctl disable network-post.service >/dev/null 2>&1 || :
+rm -f %{_sysconfdir}/systemd/system/network.target.wants/ifcfg@*.service >/dev/null 2>&1 || :
+rm -f %{_sysconfdir}/systemd/system/network.target.wants/network-post.service >/dev/null 2>&1 || :
+
 %post no-compat-tmpfiles
 %{__sed} -i -e '/^#/!s/^/# /g' %{_sysconfdir}/tmpfiles.d/compat-pld-var-run.conf
 
@@ -511,6 +504,9 @@
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vconsole.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/systemd/*.conf
 %dir %{_sysconfdir}/systemd/user
+%dir %{_sysconfdir}/systemd/system/*.target.wants
+%config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/systemd/system/*.target.wants/*.service
+%config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/systemd/system/*.target.wants/*.target
 /etc/xdg/systemd
 %attr(755,root,root) /bin/systemd
 %attr(755,root,root) /bin/systemd-ask-password
@@ -526,6 +522,7 @@
 %attr(755,root,root) %{_bindir}/systemd-nspawn
 %attr(755,root,root) %{_bindir}/systemd-stdio-bridge
 %attr(755,root,root) %{_bindir}/systemd-sysv-convert
+%attr(755,root,root) /lib/systemd/pld-storage-init
 %attr(755,root,root) /lib/systemd/systemd-*
 %dir /lib/systemd/system-generators
 %attr(755,root,root) /lib/systemd/systemd
@@ -765,6 +762,15 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.123  2012/03/14 22:01:09  baggins
+- rel 4
+- separate network services seemed line a nice idea, but it makes impossible to
+  restart enire network stack (SysV: service network restart) and it's RPITA
+  to setup anything more than simple ethX ifaces
+- add services and scripts to support LVM/RAID/etc (shameless rip from fedora)
+- package wants dirs with missingok
+- only setup basic services on first install
+
 Revision 1.122  2012/03/02 21:27:32  glen
 - -init conflicts with upstart, not base
 

================================================================
Index: packages/systemd/pld-storage-init-late.service
diff -u /dev/null packages/systemd/pld-storage-init-late.service:1.1
--- /dev/null	Wed Mar 14 23:01:15 2012
+++ packages/systemd/pld-storage-init-late.service	Wed Mar 14 23:01:09 2012
@@ -0,0 +1,13 @@
+[Unit]
+Description=Initialize storage subsystems (RAID, LVM, etc.)
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=cryptsetup.target pld-storage-init.service
+Before=local-fs.target shutdown.target
+Wants=pld-wait-storage.service
+
+[Service]
+ExecStart=/lib/systemd/pld-storage-init
+Type=oneshot
+TimeoutSec=0
+RemainAfterExit=yes

================================================================
Index: packages/systemd/pld-storage-init.service
diff -u /dev/null packages/systemd/pld-storage-init.service:1.1
--- /dev/null	Wed Mar 14 23:01:15 2012
+++ packages/systemd/pld-storage-init.service	Wed Mar 14 23:01:09 2012
@@ -0,0 +1,13 @@
+[Unit]
+Description=Initialize storage subsystems (RAID, LVM, etc.)
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=pld-wait-storage.service
+Before=local-fs.target shutdown.target
+Wants=pld-wait-storage.service
+
+[Service]
+ExecStart=/lib/systemd/pld-storage-init
+Type=oneshot
+TimeoutSec=0
+RemainAfterExit=yes

================================================================
Index: packages/systemd/pld-storage-init.sh
diff -u /dev/null packages/systemd/pld-storage-init.sh:1.1
--- /dev/null	Wed Mar 14 23:01:15 2012
+++ packages/systemd/pld-storage-init.sh	Wed Mar 14 23:01:09 2012
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Read functions
+. /lib/rc-scripts/functions
+
+if [ -x /sbin/multipath ] && ! is_no "$DM_MULTIPATH"; then
+	modprobe -s dm-mod >/dev/null 2>&1
+	modprobe -s dm-multipath >/dev/null 2>&1
+	/sbin/multipath -u -v 0
+	[ -x /sbin/kpartx ] && /sbin/dmsetup ls --target multipath --exec '/sbin/kpartx -u -a -p p'
+fi
+
+if [ -x /sbin/dmraid ]; then
+	modprobe -s dm-mod >/dev/null 2>&1
+	modprobe -s dm-mirror >/dev/null 2>&1
+	dmraidsets=$(LC_ALL=C /sbin/dmraid -s -c -i)
+	if [ "$?" = "0" ]; then
+		oldIFS=$IFS
+		IFS=$(echo -en "\n\b")
+		for dmname in $dmraidsets ; do
+			[[ "$dmname" = isw_* ]] && continue
+			/sbin/dmraid -ay -i --rm_partitions -p "$dmname"
+			[ -x /sbin/kpartx ] && /sbin/kpartx -u -a -p p "/dev/mapper/$dmname"
+		done
+                IFS=$oldIFS
+	fi
+fi
+
+# Start any MD RAID arrays that haven't been started yet
+[ -r /proc/mdstat ] && [ -r /dev/md/md-device-map ] && /sbin/mdadm -IRs
+
+if ! is_no "$LVM2" && [ -x /sbin/lvm ]; then
+	modprobe -s dm-mod >/dev/null 2>&1
+	run_cmd "Scanning for LVM volume groups" /sbin/lvm vgscan --ignorelockingfailure
+	run_cmd "Activating LVM volume groups" /sbin/lvm vgchange -a y --sysinit
+	/sbin/lvm vgmknodes --ignorelockingfailure
+fi

================================================================
Index: packages/systemd/pld-wait-storage.service
diff -u /dev/null packages/systemd/pld-wait-storage.service:1.1
--- /dev/null	Wed Mar 14 23:01:15 2012
+++ packages/systemd/pld-wait-storage.service	Wed Mar 14 23:01:09 2012
@@ -0,0 +1,18 @@
+[Unit]
+Description=Wait for storage scan
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=udev-settle.service
+Before=local-fs.target shutdown.target
+Wants=udev.service 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
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/systemd/network.service?r1=1.3&r2=1.4&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/systemd/systemd.spec?r1=1.122&r2=1.123&f=u



More information about the pld-cvs-commit mailing list