[packages/qemu] align guest agent init script and systemd unit names; rel 3

atler atler at pld-linux.org
Sat Oct 4 13:25:24 CEST 2025


commit 26249a2e92a81254ee971ff64829b087880b9913
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Oct 4 13:23:58 2025 +0200

    align guest agent init script and systemd unit names; rel 3

 qemu-guest-agent.init      | 32 ++++++++++++++++----------------
 qemu-guest-agent.logrotate |  2 +-
 qemu.spec                  | 22 +++++++++++++++-------
 3 files changed, 32 insertions(+), 24 deletions(-)
---
diff --git a/qemu.spec b/qemu.spec
index 7b68148..7c60764 100644
--- a/qemu.spec
+++ b/qemu.spec
@@ -49,7 +49,7 @@ Summary:	QEMU CPU Emulator
 Summary(pl.UTF-8):	QEMU - emulator procesora
 Name:		qemu
 Version:	10.0.3
-Release:	2
+Release:	3
 License:	GPL v2, BSD (edk2 firmware files)
 Group:		Applications/Emulators
 Source0:	https://download.qemu.org/%{name}-%{version}.tar.xz
@@ -1181,7 +1181,7 @@ install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/ksmtuned.conf
 install -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
 install -p %{SOURCE12} $RPM_BUILD_ROOT/lib/udev/rules.d
 
-install -p %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/qemu-ga
+install -p %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/qemu-guest-agent
 install -p %{SOURCE14} $RPM_BUILD_ROOT/etc/logrotate.d/qemu-ga
 
 cp -p %{SOURCE15} %{SOURCE16} $RPM_BUILD_ROOT%{systemdunitdir}
@@ -1322,20 +1322,28 @@ fi
 %systemd_post systemd-binfmt.service
 
 %post guest-agent
-/sbin/chkconfig --add qemu-ga
-%service qemu-ga restart "qemu-ga"
+/sbin/chkconfig --add qemu-guest-agent
+%service qemu-guest-agent restart "qemu-guest-agent"
 %systemd_reload
 
 %preun guest-agent
 if [ "$1" = "0" ]; then
-	%service qemu-ga stop
-	/sbin/chkconfig --del qemu-ga
+	%service qemu-guest-agent stop
+	/sbin/chkconfig --del qemu-guest-agent
 fi
 %systemd_preun qemu-guest-agent.service
 
 %postun guest-agent
 %systemd_reload
 
+%triggerun guest-agent -- qemu-guest-agent < 10.0.3-3
+if [ $1 -eq 2 ]; then
+	if [ -f /etc/init.d/qemu-ga ]; then
+		%service qemu-ga stop
+		/sbin/chkconfig --del qemu-ga
+	fi
+fi
+
 %post	-n libvfio-user -p /sbin/ldconfig
 %postun	-n libvfio-user -p /sbin/ldconfig
 
@@ -1721,7 +1729,7 @@ fi
 %attr(755,root,root) %{_bindir}/qemu-ga
 /lib/udev/rules.d/99-qemu-guest-agent.rules
 %{systemdunitdir}/qemu-guest-agent.service
-%attr(754,root,root) /etc/rc.d/init.d/qemu-ga
+%attr(754,root,root) /etc/rc.d/init.d/qemu-guest-agent
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/qemu-ga
 %{_mandir}/man7/qemu-ga-ref.7*
 %{_mandir}/man8/qemu-ga.8*
diff --git a/qemu-guest-agent.init b/qemu-guest-agent.init
index 076f5b7..374f4d0 100755
--- a/qemu-guest-agent.init
+++ b/qemu-guest-agent.init
@@ -1,10 +1,10 @@
 #!/bin/sh
 #
-# qemu-ga	qemu-ga	QEMU Guest Agent
+# qemu-guest-agent	qemu-ga	QEMU Guest Agent
 #
-# chkconfig:	345 12 88
+# chkconfig:		345 12 88
 #
-# description:	qemu-ga QEMU Guest Agent
+# description:		qemu-ga QEMU Guest Agent
 
 # Source function library
 . /etc/rc.d/init.d/functions
@@ -28,7 +28,7 @@ checkconfig() {
 
 	if [ $details = 1 ]; then
 		# run config test and display report (status action)
-		show "Checking %s configuration" "qemu-ga"; busy
+		show "Checking %s configuration" "qemu-guest-agent"; busy
 		local out
 		out=$(configtest 2>&1)
 		RETVAL=$?
@@ -44,7 +44,7 @@ checkconfig() {
 		configtest >/dev/null 2>&1
 		RETVAL=$?
 		if [ $RETVAL != 0 ]; then
-			show "Checking %s configuration" "qemu-ga"; fail
+			show "Checking %s configuration" "qemu-guest-agent"; fail
 			nls 'Configuration test failed. See details with %s "checkconfig"' $0
 			exit $RETVAL
 		fi
@@ -53,33 +53,33 @@ checkconfig() {
 
 start() {
 	# Check if the service is already running?
-	if [ -f /var/lock/subsys/qemu-ga ]; then
-		msg_already_running "qemu-ga"
+	if [ -f /var/lock/subsys/qemu-guest-agent ]; then
+		msg_already_running "qemu-guest-agent"
 		return
 	fi
 
 	checkconfig
-	msg_starting "qemu-ga"
+	msg_starting "qemu-guest-agent"
 	daemon /usr/bin/qemu-ga -d
 	RETVAL=$?
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/qemu-ga
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/qemu-guest-agent
 }
 
 stop() {
-	if [ ! -f /var/lock/subsys/qemu-ga ]; then
-		msg_not_running "qemu-ga"
+	if [ ! -f /var/lock/subsys/qemu-guest-agent ]; then
+		msg_not_running "qemu-guest-agent"
 		return
 	fi
 
 	# Stop daemons.
-	msg_stopping "qemu-ga"
+	msg_stopping "qemu-guest-agent"
 	killproc --pidfile $pidfile qemu-ga -TERM
-	rm -f /var/lock/subsys/qemu-ga
+	rm -f /var/lock/subsys/qemu-guest-agent
 }
 
 condrestart() {
-	if [ ! -f /var/lock/subsys/qemu-ga ]; then
-		msg_not_running "qemu-ga"
+	if [ ! -f /var/lock/subsys/qemu-guest-agent ]; then
+		msg_not_running "qemu-guest-agent"
 		RETVAL=$1
 		return
 	fi
@@ -113,7 +113,7 @@ case "$1" in
 	checkconfig 1
 	;;
   status)
-	status --pidfile $pidfile qemu-ga
+	status --pidfile $pidfile qemu-guest-agent qemu-ga
 	RETVAL=$?
 	;;
   *)
diff --git a/qemu-guest-agent.logrotate b/qemu-guest-agent.logrotate
index 0c64059..3ec2602 100644
--- a/qemu-guest-agent.logrotate
+++ b/qemu-guest-agent.logrotate
@@ -1,6 +1,6 @@
 /var/log/qemu-ga
 {
 	postrotate
-		/sbin/service qemu-ga restart >/dev/null
+		/sbin/service qemu-guest-agent restart >/dev/null
 	endscript
 }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/qemu.git/commitdiff/26249a2e92a81254ee971ff64829b087880b9913



More information about the pld-cvs-commit mailing list