[libvirt] [PATCH v2 0/6] Drop support for certain init scripts

Changes from [v1]: * drop support for "Red Hat" init scripts in addition to Upstart. [v1] https://www.redhat.com/archives/libvir-list/2019-March/msg00917.html Andrea Bolognani (6): travis: Stop using --with-init-script travis: Drop $DISTCHECK_CONFIGURE_FLAGS Drop support for Upstart init scripts Drop support for "Red Hat" init scripts m4: Simplify LIBVIRT_CHECK_INIT_SCRIPT news: Document dropping support for certain init scripts .gitignore | 1 - .travis.yml | 5 +- docs/news.xml | 13 ++++ m4/virt-init-script.m4 | 30 ++------- src/Makefile.am | 61 ----------------- src/locking/Makefile.inc.am | 9 --- src/locking/virtlockd.init.in | 98 --------------------------- src/logging/Makefile.inc.am | 11 --- src/logging/virtlogd.init.in | 98 --------------------------- src/remote/Makefile.inc.am | 4 -- src/remote/libvirtd.init.in | 122 ---------------------------------- src/remote/libvirtd.upstart | 47 ------------- tools/Makefile.am | 33 +-------- tools/libvirt-guests.init.in | 30 --------- 14 files changed, 22 insertions(+), 540 deletions(-) delete mode 100644 src/locking/virtlockd.init.in delete mode 100644 src/logging/virtlogd.init.in delete mode 100644 src/remote/libvirtd.init.in delete mode 100644 src/remote/libvirtd.upstart delete mode 100644 tools/libvirt-guests.init.in -- 2.20.1

We're gonna drop support for non-systemd init scripts soon, and we don't want Travis CI builds to break when we do. Since we have init system auto-detection, we can just rely on that and stop passing --with-init-script to configure entirely. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 55ba340a34..0e7a1a033c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,13 +11,11 @@ matrix: - docker env: - IMAGE="ubuntu-18" - - DISTCHECK_CONFIGURE_FLAGS="--with-init-script=systemd" - DOCKER_CMD="$LINUX_CMD" - services: - docker env: - IMAGE="centos-7" - - DISTCHECK_CONFIGURE_FLAGS="--with-init-script=upstart" - DOCKER_CMD="$LINUX_CMD" - services: - docker -- 2.20.1

On Fri, Mar 15, 2019 at 06:27:38PM +0100, Andrea Bolognani wrote:
We're gonna drop support for non-systemd init scripts soon, and we don't want Travis CI builds to break when we do.
Since we have init system auto-detection, we can just rely on that and stop passing --with-init-script to configure entirely.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .travis.yml | 2 -- 1 file changed, 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

It's no longer used. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e7a1a033c..54de7dd7ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,6 @@ script: -w /build -e VIR_TEST_DEBUG="$VIR_TEST_DEBUG" -e MINGW="$MINGW" - -e DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS" "quay.io/libvirt/buildenv-$IMAGE:master" /bin/sh -xc "$DOCKER_CMD" @@ -56,7 +55,7 @@ env: - LINUX_CMD=" ./autogen.sh && make -j3 syntax-check && - make -j3 distcheck DISTCHECK_CONFIGURE_FLAGS=\"\$DISTCHECK_CONFIGURE_FLAGS\" || + make -j3 distcheck || ( echo '=== LOG FILE(S) START ==='; find -name test-suite.log | xargs cat; -- 2.20.1

On Fri, Mar 15, 2019 at 06:27:39PM +0100, Andrea Bolognani wrote:
It's no longer used.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Not a single one of the platforms we target still uses Upstart, and the Upstart project itself has been abandoned for several years now. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> --- m4/virt-init-script.m4 | 7 +----- src/Makefile.am | 29 ----------------------- src/remote/Makefile.inc.am | 2 -- src/remote/libvirtd.upstart | 47 ------------------------------------- 4 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 src/remote/libvirtd.upstart diff --git a/m4/virt-init-script.m4 b/m4/virt-init-script.m4 index 757fd10541..7094e29f46 100644 --- a/m4/virt-init-script.m4 +++ b/m4/virt-init-script.m4 @@ -20,7 +20,7 @@ dnl AC_DEFUN([LIBVIRT_ARG_INIT_SCRIPT],[ LIBVIRT_ARG_WITH([INIT_SCRIPT], [Style of init script to install: redhat, systemd, - systemd+redhat, upstart, check, none], [check]) + systemd+redhat, check, none], [check]) ]) AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ @@ -28,7 +28,6 @@ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ init_redhat=no init_systemd=no - init_upstart=no if test "$with_init_script" = check && test "$cross_compiling" = yes; then with_init_script=none @@ -51,9 +50,6 @@ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ [systemd],[ init_systemd=yes ], - [upstart],[ - init_upstart=yes - ], [redhat],[ init_redhat=yes ], @@ -64,7 +60,6 @@ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ ) AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test "$init_redhat" = "yes") - AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_UPSTART], test "$init_upstart" = "yes") AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD], test "$init_systemd" = "yes") AC_MSG_RESULT($with_init_script) diff --git a/src/Makefile.am b/src/Makefile.am index 5dc9990c17..94a9a7c27d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -85,7 +85,6 @@ PODFILES = MANINFILES = SYSTEMD_UNIT_FILES_IN = SYSVINIT_FILES_IN = -UPSTART_FILES = SYSCONF_FILES = sbin_PROGRAMS = man8_MANS = @@ -872,34 +871,6 @@ endif LIBVIRT_INIT_SCRIPT_SYSTEMD endif WITH_LIBVIRTD -EXTRA_DIST += $(UPSTART_FILES) - -if WITH_LIBVIRTD -if LIBVIRT_INIT_SCRIPT_UPSTART - -install-upstart: install-sysconfig - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d - for f in $(UPSTART_FILES:%.upstart=%); \ - do \ - tgt=`basename $$f` ; \ - $(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \ - $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \ - done - -uninstall-upstart: uninstall-sysconfig - for f in $(UPSTART_FILES:%.upstart=%); \ - do \ - tgt=`basename $$f` ; \ - rm -f $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \ - done - rmdir $(DESTDIR)$(sysconfdir)/event.d || : - -INSTALL_DATA_LOCAL += install-upstart -UNINSTALL_LOCAL += uninstall-upstart -endif LIBVIRT_INIT_SCRIPT_UPSTART -endif WITH_LIBVIRTD - - EXTRA_DIST += dtrace2systemtap.pl diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 468a3f5d97..bc1d7f462f 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -54,8 +54,6 @@ SYSTEMD_UNIT_FILES_IN += \ remote/virt-guest-shutdown.target.in \ $(NULL) -UPSTART_FILES += remote/libvirtd.upstart - REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x diff --git a/src/remote/libvirtd.upstart b/src/remote/libvirtd.upstart deleted file mode 100644 index e620f41450..0000000000 --- a/src/remote/libvirtd.upstart +++ /dev/null @@ -1,47 +0,0 @@ -# libvirtd upstart job -# -# XXX wait for rc to get all dependent initscripts started -# from sysv libvirtd initscript: Required-Start: $network messagebus -start on stopped rc RUNLEVEL=[345] -stop on runlevel [!345] - -respawn - -script - LIBVIRTD_CONFIG= - LIBVIRTD_ARGS= - KRB5_KTNAME=/etc/libvirt/krb5.tab - - if [ -f /etc/sysconfig/libvirtd ]; then - . /etc/sysconfig/libvirtd - fi - - export QEMU_AUDIO_DRV - export SDL_AUDIODRIVER - export KRB5_KTNAME - - LIBVIRTD_CONFIG_ARGS= - if [ -n "$LIBVIRTD_CONFIG" ]; then - LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG" - fi - - # DAEMON_COREFILE_LIMIT from /etc/sysconfig/libvirtd is not handled - # automatically - if [ -n "$DAEMON_COREFILE_LIMIT" ]; then - ulimit -c "$DAEMON_COREFILE_LIMIT" - fi - - # LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled - # automatically - if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then - ulimit -n "$LIBVIRTD_NOFILES_LIMIT" - fi - mkdir -p /var/cache/libvirt - rm -rf /var/cache/libvirt/* - - exec /usr/sbin/libvirtd $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS -end script - -post-stop script - rm -rf /var/cache/libvirt/* -end script -- 2.20.1

Despite the misleading name, these were supposed to be used with a System V style init; however, none of the platforms we target is using that kind of init anymore: almost all Linux distributions have switched to systemd, those that haven't (such as Gentoo and Alpine) are mostly using OpenRC with custom init scripts, and the BSDs have been doing their own thing all along. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .gitignore | 1 - m4/virt-init-script.m4 | 16 +---- src/Makefile.am | 32 --------- src/locking/Makefile.inc.am | 9 --- src/locking/virtlockd.init.in | 98 --------------------------- src/logging/Makefile.inc.am | 11 --- src/logging/virtlogd.init.in | 98 --------------------------- src/remote/Makefile.inc.am | 2 - src/remote/libvirtd.init.in | 122 ---------------------------------- tools/Makefile.am | 33 +-------- tools/libvirt-guests.init.in | 30 --------- 11 files changed, 5 insertions(+), 447 deletions(-) delete mode 100644 src/locking/virtlockd.init.in delete mode 100644 src/logging/virtlogd.init.in delete mode 100644 src/remote/libvirtd.init.in delete mode 100644 tools/libvirt-guests.init.in diff --git a/.gitignore b/.gitignore index 3303eed411..3223cf1b76 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ *.gcov *.html *.i -*.init *.la *.lo *.loT diff --git a/m4/virt-init-script.m4 b/m4/virt-init-script.m4 index 7094e29f46..8045fc06bb 100644 --- a/m4/virt-init-script.m4 +++ b/m4/virt-init-script.m4 @@ -19,14 +19,13 @@ dnl AC_DEFUN([LIBVIRT_ARG_INIT_SCRIPT],[ LIBVIRT_ARG_WITH([INIT_SCRIPT], - [Style of init script to install: redhat, systemd, - systemd+redhat, check, none], [check]) + [Style of init script to install: systemd, check, none], + [check]) ]) AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ AC_MSG_CHECKING([for init script type]) - init_redhat=no init_systemd=no if test "$with_init_script" = check && test "$cross_compiling" = yes; then @@ -35,31 +34,20 @@ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ if test "$with_init_script" = check && type systemctl >/dev/null 2>&1; then with_init_script=systemd fi - if test "$with_init_script" = check && test -f /etc/redhat-release; then - with_init_script=redhat - fi if test "$with_init_script" = check; then with_init_script=none fi AS_CASE([$with_init_script], - [systemd+redhat],[ - init_redhat=yes - init_systemd=yes - ], [systemd],[ init_systemd=yes ], - [redhat],[ - init_redhat=yes - ], [none],[], [*],[ AC_MSG_ERROR([Unknown initscript flavour $with_init_script]) ] ) - AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test "$init_redhat" = "yes") AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD], test "$init_systemd" = "yes") AC_MSG_RESULT($with_init_script) diff --git a/src/Makefile.am b/src/Makefile.am index 94a9a7c27d..a73f43c483 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -84,7 +84,6 @@ LOGROTATE_FILES_IN = PODFILES = MANINFILES = SYSTEMD_UNIT_FILES_IN = -SYSVINIT_FILES_IN = SYSCONF_FILES = sbin_PROGRAMS = man8_MANS = @@ -765,14 +764,6 @@ uninstall-sysconfig: done rmdir $(DESTDIR)$(sysconfdir)/sysconfig || : -SYSVINIT_FILES_IN += \ - locking/virtlockd.init.in \ - $(NULL) - -SYSVINIT_FILES = $(notdir $(SYSVINIT_FILES_IN:%.in=%)) - -EXTRA_DIST += $(SYSVINIT_FILES_IN) - LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%) EXTRA_DIST += $(LOGROTATE_FILES_IN) @@ -804,29 +795,6 @@ INSTALL_DATA_LOCAL += install-logrotate UNINSTALL_LOCAL += uninstall-logrotate endif WITH_LIBVIRTD -if WITH_LIBVIRTD -if LIBVIRT_INIT_SCRIPT_RED_HAT -initdir = $(sysconfdir)/rc.d/init.d - -install-init: $(SYSVINIT_FILES) install-sysconfig - $(MKDIR_P) $(DESTDIR)$(initdir) - for f in $(SYSVINIT_FILES:%.init=%) ; \ - do \ - $(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(initdir)/$$f; \ - done - -uninstall-init: uninstall-sysconfig - rm -f $(SYSVINIT_FILES:%.init=$(DESTDIR)$(initdir)/%) - rmdir $(DESTDIR)$(initdir) || : - -BUILT_SOURCES += $(SYSVINIT_FILES) -DISTCLEANFILES += $(SYSVINIT_FILES) - -INSTALL_DATA_LOCAL += install-init -UNINSTALL_LOCAL += uninstall-init -endif LIBVIRT_INIT_SCRIPT_RED_HAT -endif WITH_LIBVIRTD - %.8: %.8.in $(top_srcdir)/configure.ac $(AM_V_GEN)sed \ diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index f2eb2efb7b..6de7f7bab8 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -305,15 +305,6 @@ virtlockd-admin.socket: locking/virtlockd-admin.socket.in \ < $< > $@-t && \ mv $@-t $@ -virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ - mv $@-t $@ - virtlockd.8.in: locking/virtlockd.pod $(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \ if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \ diff --git a/src/locking/virtlockd.init.in b/src/locking/virtlockd.init.in deleted file mode 100644 index 0bf868ca7f..0000000000 --- a/src/locking/virtlockd.init.in +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/sh - -# the following is the LSB init header see -# http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-gene... -# -### BEGIN INIT INFO -# Provides: virtlockd -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Required-Start: -# Required-Stop: -# Should-Start: $network $remote_fs -# Should-Stop: $network $remote_fs -# Short-Description: virtual machine lock manager -# Description: This is a daemon for managing locks -# on virtual machine disk images -### END INIT INFO - -# the following is chkconfig init header -# -# virtlockd: virtual machine lock manager -# -# chkconfig: 345 96 04 -# description: This is a daemon for managing locks \ -# on virtual machine disk images -# -# processname: virtlockd -# pidfile: @localstatedir@/run/virtlockd.pid -# - -# Source function library. -. @sysconfdir@/rc.d/init.d/functions - -SERVICE=virtlockd -PROCESS=virtlockd -PIDFILE=@localstatedir@/run/$SERVICE.pid - -VIRTLOCKD_ARGS= - -test -f @sysconfdir@/sysconfig/virtlockd && . @sysconfdir@/sysconfig/virtlockd - -RETVAL=0 - -start() { - echo -n $"Starting $SERVICE daemon: " - daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOCKD_ARGS - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE -} - -stop() { - echo -n $"Stopping $SERVICE daemon: " - - killproc -p $PIDFILE $PROCESS - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f @localstatedir@/lock/subsys/$SERVICE - rm -f $PIDFILE - fi -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $SERVICE configuration: " - - killproc -p $PIDFILE $PROCESS -USR1 - RETVAL=$? - echo - return $RETVAL -} - -# See how we were called. -case "$1" in - start|stop|restart|reload) - $1 - ;; - status) - status -p $PIDFILE $PROCESS - RETVAL=$? - ;; - force-reload) - reload - ;; - condrestart|try-restart) - [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}" - exit 2 - ;; -esac -exit $RETVAL diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index ae022ade0b..a4739b2d44 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -26,8 +26,6 @@ LOG_DAEMON_SOURCES = \ LOG_PROTOCOL = $(srcdir)/logging/log_protocol.x -SYSVINIT_FILES_IN += logging/virtlogd.init.in - EXTRA_DIST += \ $(LOG_PROTOCOL) \ $(LOG_PROTOCOL_GENERATED) \ @@ -116,15 +114,6 @@ logging/log_daemon_dispatch_stubs.h: $(LOG_PROTOCOL) \ virLogManagerProtocol VIR_LOG_MANAGER_PROTOCOL \ $(LOG_PROTOCOL) > $(srcdir)/logging/log_daemon_dispatch_stubs.h -virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ - mv $@-t $@ - virtlogd.8.in: logging/virtlogd.pod $(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \ if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \ diff --git a/src/logging/virtlogd.init.in b/src/logging/virtlogd.init.in deleted file mode 100644 index 6aa8815046..0000000000 --- a/src/logging/virtlogd.init.in +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/sh - -# the following is the LSB init header see -# http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-gene... -# -### BEGIN INIT INFO -# Provides: virtlogd -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Required-Start: -# Required-Stop: -# Should-Start: $network $remote_fs -# Should-Stop: $network $remote_fs -# Short-Description: virtual machine log manager -# Description: This is a daemon for managing logs -# of virtual machine consoles -### END INIT INFO - -# the following is chkconfig init header -# -# virtlogd: virtual machine log manager -# -# chkconfig: 345 96 04 -# description: This is a daemon for managing logs \ -# of virtual machine consoles -# -# processname: virtlogd -# pidfile: @localstatedir@/run/virtlogd.pid -# - -# Source function library. -. @sysconfdir@/rc.d/init.d/functions - -SERVICE=virtlogd -PROCESS=virtlogd -PIDFILE=@localstatedir@/run/$SERVICE.pid - -VIRTLOGD_ARGS= - -test -f @sysconfdir@/sysconfig/virtlogd && . @sysconfdir@/sysconfig/virtlogd - -RETVAL=0 - -start() { - echo -n $"Starting $SERVICE daemon: " - daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOGD_ARGS - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE -} - -stop() { - echo -n $"Stopping $SERVICE daemon: " - - killproc -p $PIDFILE $PROCESS - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f @localstatedir@/lock/subsys/$SERVICE - rm -f $PIDFILE - fi -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $SERVICE configuration: " - - killproc -p $PIDFILE $PROCESS -USR1 - RETVAL=$? - echo - return $RETVAL -} - -# See how we were called. -case "$1" in - start|stop|restart|reload) - $1 - ;; - status) - status -p $PIDFILE $PROCESS - RETVAL=$? - ;; - force-reload) - reload - ;; - condrestart|try-restart) - [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}" - exit 2 - ;; -esac -exit $RETVAL diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index bc1d7f462f..dccecf8cd3 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -42,8 +42,6 @@ LOGROTATE_FILES_IN += \ remote/libvirtd.logrotate.in \ $(NULL) -SYSVINIT_FILES_IN += remote/libvirtd.init.in - SYSCONF_FILES += remote/libvirtd.sysconf PODFILES += remote/libvirtd.pod diff --git a/src/remote/libvirtd.init.in b/src/remote/libvirtd.init.in deleted file mode 100644 index d81dca6f2e..0000000000 --- a/src/remote/libvirtd.init.in +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh - -# the following is the LSB init header see -# http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-gene... -# -### BEGIN INIT INFO -# Provides: libvirtd -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Required-Start: $network messagebus virtlogd -# Required-Stop: $network messagebus -# Should-Start: $named xend avahi-daemon virtlockd -# Should-Stop: $named -# Short-Description: daemon for libvirt virtualization API -# Description: This is a daemon for managing guest instances -# and libvirt virtual networks -# See https://libvirt.org -### END INIT INFO - -# the following is chkconfig init header -# -# libvirtd: guest and virtual network management daemon -# -# chkconfig: 345 97 03 -# description: This is a daemon for managing guest instances \ -# and libvirt virtual networks \ -# See https://libvirt.org -# -# processname: libvirtd -# pidfile: @localstatedir@/run/libvirtd.pid -# - -# Source function library. -. @sysconfdir@/rc.d/init.d/functions - -SERVICE=libvirtd -PROCESS=libvirtd -PIDFILE=@localstatedir@/run/$SERVICE.pid - -LIBVIRTD_CONFIG= -LIBVIRTD_ARGS= -KRB5_KTNAME=/etc/libvirt/krb5.tab - -test -f @sysconfdir@/sysconfig/libvirtd && . @sysconfdir@/sysconfig/libvirtd - -export QEMU_AUDIO_DRV -export SDL_AUDIODRIVER - -LIBVIRTD_CONFIG_ARGS= -if [ -n "$LIBVIRTD_CONFIG" ] -then - LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG" -fi - -RETVAL=0 - -start() { - echo -n $"Starting $SERVICE daemon: " - mkdir -p @localstatedir@/cache/libvirt - rm -rf @localstatedir@/cache/libvirt/* - - # LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled - # automatically - if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then - ulimit -n "$LIBVIRTD_NOFILES_LIMIT" - fi - - KRB5_KTNAME=$KRB5_KTNAME daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE -} - -stop() { - echo -n $"Stopping $SERVICE daemon: " - - killproc -p $PIDFILE $PROCESS - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f @localstatedir@/lock/subsys/$SERVICE - rm -rf @localstatedir@/cache/libvirt/* - else - exit $RETVAL - fi -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $SERVICE configuration: " - - killproc -p $PIDFILE $PROCESS -HUP - RETVAL=$? - echo - return $RETVAL -} - -# See how we were called. -case "$1" in - start|stop|restart|reload) - $1 - ;; - status) - status -p $PIDFILE $PROCESS - RETVAL=$? - ;; - force-reload) - reload - ;; - condrestart|try-restart) - [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}" - exit 2 - ;; -esac -exit $RETVAL diff --git a/tools/Makefile.am b/tools/Makefile.am index 95025ced43..c6064dee08 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -327,10 +327,10 @@ POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)" < $< > $@-t && \ mv $@-t $@ -install-data-local: install-init install-systemd install-nss \ +install-data-local: install-systemd install-nss \ install-bash-completion -uninstall-local: uninstall-init uninstall-systemd uninstall-nss \ +uninstall-local: uninstall-systemd uninstall-nss \ uninstall-bash-completion install-sysconfig: @@ -342,26 +342,7 @@ uninstall-sysconfig: rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||: -EXTRA_DIST += libvirt-guests.sh.in libvirt-guests.init.in - -install-initscript: libvirt-guests.init - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d - $(INSTALL_SCRIPT) libvirt-guests.init \ - $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests - -uninstall-initscript: - rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests - rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d ||: - - -if LIBVIRT_INIT_SCRIPT_RED_HAT -BUILT_SOURCES += libvirt-guests.init -install-init: install-sysconfig install-initscript -uninstall-init: uninstall-sysconfig uninstall-initscript -else ! LIBVIRT_INIT_SCRIPT_RED_HAT -install-init: -uninstall-init: -endif ! LIBVIRT_INIT_SCRIPT_RED_HAT +EXTRA_DIST += libvirt-guests.sh.in libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status $(AM_V_GEN)sed \ @@ -376,14 +357,6 @@ libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status mv $@-t $@ BUILT_SOURCES += libvirt-guests.sh -libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh - $(AM_V_GEN)sed \ - -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ - mv $@-t $@ - - EXTRA_DIST += libvirt-guests.service.in SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system diff --git a/tools/libvirt-guests.init.in b/tools/libvirt-guests.init.in deleted file mode 100644 index 495d4c7d1d..0000000000 --- a/tools/libvirt-guests.init.in +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# the following is the LSB init header see -# http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-gene... -# -### BEGIN INIT INFO -# Provides: libvirt-guests -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Required-Start: libvirtd -# Required-Stop: libvirtd -# Should-Start: -# Should-Stop: -# Short-Description: suspend/resume libvirt guests on shutdown/boot -# Description: This is a script for suspending active libvirt guests -# on shutdown and resuming them on next boot -# See https://libvirt.org -### END INIT INFO - -# the following is chkconfig init header -# -# libvirt-guests: suspend/resume libvirt guests on shutdown/boot -# -# chkconfig: 345 99 01 -# description: This is a script for suspending active libvirt guests \ -# on shutdown and resuming them on next boot \ -# See https://libvirt.org -# - -exec @libexecdir@/libvirt-guests.sh "$@" -- 2.20.1

On Fri, Mar 15, 2019 at 06:27:41PM +0100, Andrea Bolognani wrote:
Despite the misleading name, these were supposed to be used with a System V style init; however, none of the platforms we target is using that kind of init anymore: almost all Linux distributions have switched to systemd, those that haven't (such as Gentoo and Alpine) are mostly using OpenRC with custom init scripts, and the BSDs have been doing their own thing all along.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .gitignore | 1 - m4/virt-init-script.m4 | 16 +---- src/Makefile.am | 32 --------- src/locking/Makefile.inc.am | 9 --- src/locking/virtlockd.init.in | 98 --------------------------- src/logging/Makefile.inc.am | 11 --- src/logging/virtlogd.init.in | 98 --------------------------- src/remote/Makefile.inc.am | 2 - src/remote/libvirtd.init.in | 122 ---------------------------------- tools/Makefile.am | 33 +-------- tools/libvirt-guests.init.in | 30 --------- 11 files changed, 5 insertions(+), 447 deletions(-) delete mode 100644 src/locking/virtlockd.init.in delete mode 100644 src/logging/virtlogd.init.in delete mode 100644 src/remote/libvirtd.init.in delete mode 100644 tools/libvirt-guests.init.in
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Now that we no longer support the weird "redhat+systemd" configuration, we can make our code slightly simpler. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- m4/virt-init-script.m4 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/m4/virt-init-script.m4 b/m4/virt-init-script.m4 index 8045fc06bb..91bbd68235 100644 --- a/m4/virt-init-script.m4 +++ b/m4/virt-init-script.m4 @@ -26,8 +26,6 @@ AC_DEFUN([LIBVIRT_ARG_INIT_SCRIPT],[ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ AC_MSG_CHECKING([for init script type]) - init_systemd=no - if test "$with_init_script" = check && test "$cross_compiling" = yes; then with_init_script=none fi @@ -39,16 +37,15 @@ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ fi AS_CASE([$with_init_script], - [systemd],[ - init_systemd=yes - ], + [systemd],[], [none],[], [*],[ AC_MSG_ERROR([Unknown initscript flavour $with_init_script]) ] ) - AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD], test "$init_systemd" = "yes") + AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD], + [test "$with_init_script" = "systemd"]) AC_MSG_RESULT($with_init_script) ]) -- 2.20.1

On Fri, Mar 15, 2019 at 06:27:42PM +0100, Andrea Bolognani wrote:
Now that we no longer support the weird "redhat+systemd" configuration, we can make our code slightly simpler.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- m4/virt-init-script.m4 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/news.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index cc07b5dd0a..bb548f1ec1 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -95,6 +95,19 @@ </description> </change> </section> + <section title="Removed features"> + <change> + <summary> + Drop support for Upstart and "Red Hat" init scripts + </summary> + <description> + Not a single one of the platforms we target still uses Upstart, + and the Upstart project itself has been abandoned for several years + now; the same is true for the "Red Hat" (really System V) init + scripts, since RHEL 7 and later releases use systemd. + </description> + </change> + </section> <section title="Improvements"> </section> <section title="Bug fixes"> -- 2.20.1

On Fri, Mar 15, 2019 at 06:27:43PM +0100, Andrea Bolognani wrote:
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/news.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Andrea Bolognani
-
Daniel P. Berrangé