mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-21 21:17:37 -08:00
app-emulation/qemu-guest-agent: Modernize init script
Long due improvement. Instead of defining our own start() and stop() function, let's just define corresponding variables and let openrc do its job. Signed-off-by: Michal Privoznik <michal.privoznik@gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/43567 Closes: https://github.com/gentoo/gentoo/pull/43567 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
parent
1d5cfbbf84
commit
574a28c2be
@ -1,24 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
start() {
|
||||
GA_METHOD=${GA_METHOD:-virtio-serial}
|
||||
GA_PATH=${GA_PATH:-/dev/virtio-ports/org.qemu.guest_agent.0}
|
||||
|
||||
ebegin "Starting QEMU Guest Agent"
|
||||
|
||||
start-stop-daemon --start --pidfile /run/qemu-ga.pid \
|
||||
--exec /usr/bin/qemu-ga -- -m ${GA_METHOD} -p ${GA_PATH} \
|
||||
-l /var/log/qemu-ga.log -d -f /run/qemu-ga.pid -t /run ${GA_OPTIONS}
|
||||
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping QEMU Guest Agent"
|
||||
|
||||
start-stop-daemon --stop --pidfile /run/qemu-ga.pid
|
||||
|
||||
eend $?
|
||||
}
|
||||
11
app-emulation/qemu-guest-agent/files/qemu-ga.init-r2
Normal file
11
app-emulation/qemu-guest-agent/files/qemu-ga.init-r2
Normal file
@ -0,0 +1,11 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2024 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
GA_METHOD=${GA_METHOD:-virtio-serial}
|
||||
GA_PATH=${GA_PATH:-/dev/virtio-ports/org.qemu.guest_agent.0}
|
||||
|
||||
description="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
|
||||
command="/usr/bin/qemu-ga"
|
||||
pidfile="/run/qemu-ga.pid"
|
||||
command_args="-m ${GA_METHOD} -p ${GA_PATH} -l /var/log/qemu-ga.log -d -f ${pidfile} -t /run ${GA_OPTIONS}"
|
||||
@ -84,7 +84,7 @@ src_install() {
|
||||
dobin build/qga/qemu-ga
|
||||
|
||||
# Normal init stuff
|
||||
newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
|
||||
newinitd "${FILESDIR}/qemu-ga.init-r2" qemu-guest-agent
|
||||
newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
|
||||
|
||||
insinto /etc/logrotate.d
|
||||
|
||||
@ -84,7 +84,7 @@ src_install() {
|
||||
dobin build/qga/qemu-ga
|
||||
|
||||
# Normal init stuff
|
||||
newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
|
||||
newinitd "${FILESDIR}/qemu-ga.init-r2" qemu-guest-agent
|
||||
newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
|
||||
|
||||
insinto /etc/logrotate.d
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user