packages: udev/udev.spec - restart udevd on upgrade

wiget wiget at pld-linux.org
Sun Dec 4 18:26:58 CET 2011


Author: wiget                        Date: Sun Dec  4 17:26:58 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- restart udevd on upgrade

---- Files affected:
packages/udev:
   udev.spec (1.363 -> 1.364) 

---- Diffs:

================================================================
Index: packages/udev/udev.spec
diff -u packages/udev/udev.spec:1.363 packages/udev/udev.spec:1.364
--- packages/udev/udev.spec:1.363	Sun Dec  4 16:06:43 2011
+++ packages/udev/udev.spec	Sun Dec  4 18:26:53 2011
@@ -33,7 +33,7 @@
 Name:		udev
 # Verify ChangeLog and NEWS when updating (since there are incompatible/breaking changes very often)
 Version:	175
-Release:	1
+Release:	2
 Epoch:		1
 License:	GPL v2+
 Group:		Base
@@ -71,7 +71,7 @@
 BuildRequires:	pciutils
 BuildRequires:	pkgconfig
 BuildRequires:	python-modules
-BuildRequires:	rpmbuild(macros) >= 1.623
+BuildRequires:	rpmbuild(macros) >= 1.626
 BuildRequires:	sed >= 4.0
 BuildRequires:	usbutils >= 0.82
 BuildRequires:	zlib-devel
@@ -430,6 +430,16 @@
 %triggerpostun core -- udev < 165
 /sbin/udevadm info --convert-db
 
+%post core
+if [ $1 -gt 1 ]; then
+	if [ ! -x /sbin/systemd_booted ] || ! /sbin/systemd_booted; then
+		if [ -n "$(pidof udevd)" ]; then
+			/sbin/udevadm control --exit
+			/lib/udev/udevd --daemon
+		fi
+	fi
+fi
+ 
 %post	libs -p /sbin/ldconfig
 %postun	libs -p /sbin/ldconfig
 
@@ -437,11 +447,17 @@
 %postun	glib -p /sbin/ldconfig
 
 %post systemd
-%systemd_post
-%systemd_enable udev.service
+%systemd_post udev-settle.service
+if [ $1 -gt 1 ] && /sbin/systemd_booted; then
+	SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+	/bin/systemctl --quiet try-restart udev.service || :
+fi
+
+%preun systemd
+%systemd_preun udev-settle.service
 
 %postun systemd
-%systemd_postun udev.service
+%systemd_reload
 
 %files
 %defattr(644,root,root,755)
@@ -617,6 +633,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.364  2011/12/04 17:26:53  wiget
+- restart udevd on upgrade
+
 Revision 1.363  2011/12/04 15:06:43  qboosh
 - pl for -systemd
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/udev/udev.spec?r1=1.363&r2=1.364&f=u



More information about the pld-cvs-commit mailing list