]> xenbits.xensource.com Git - libvirt.git/commitdiff
Drop support for "Red Hat" init scripts
authorAndrea Bolognani <abologna@redhat.com>
Fri, 15 Mar 2019 15:47:27 +0000 (16:47 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 15 Mar 2019 17:36:19 +0000 (18:36 +0100)
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>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
.gitignore
m4/virt-init-script.m4
src/Makefile.am
src/locking/Makefile.inc.am
src/locking/virtlockd.init.in [deleted file]
src/logging/Makefile.inc.am
src/logging/virtlogd.init.in [deleted file]
src/remote/Makefile.inc.am
src/remote/libvirtd.init.in [deleted file]
tools/Makefile.am
tools/libvirt-guests.init.in [deleted file]

index 3303eed411cc9b590d9a6e41c25693b13b4486c8..3223cf1b765c41ae60b839d486dfa39676eaec0e 100644 (file)
@@ -11,7 +11,6 @@
 *.gcov
 *.html
 *.i
-*.init
 *.la
 *.lo
 *.loT
index 7094e29f4629052c7282dc831977ecb8efb7e546..8045fc06bbcb34faed02c2dc3890ec4be4e30352 100644 (file)
@@ -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)
index 94a9a7c27d29caba154c381560ecd6a6a95346c6..a73f43c4835b63a5c31e20057668a98608112506 100644 (file)
@@ -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 \
index f2eb2efb7bca5db628581345f7d6be8938beb6f6..6de7f7bab873edfa79ec0552df61c5eb848fe1ba 100644 (file)
@@ -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 (file)
index 0bf868c..0000000
+++ /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-generic/initscrcomconv.html
-#
-### 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
index ae022ade0bae6c3d02a13fe3dcddffca5352e7d6..a4739b2d44369b5d4023e7573f94bc31c2134df4 100644 (file)
@@ -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 (file)
index 6aa8815..0000000
+++ /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-generic/initscrcomconv.html
-#
-### 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
index bc1d7f462fe4cf8ee6623813e7eba7f2cf1f4478..dccecf8cd31775a8739876b015a55ff1e14e275d 100644 (file)
@@ -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 (file)
index d81dca6..0000000
+++ /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-generic/initscrcomconv.html
-#
-### 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
index 95025ced43450decda7773afdcfd99952c38f23f..c6064dee08683fc54463e402e063742c11bb97c8 100644 (file)
@@ -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 (file)
index 495d4c7..0000000
+++ /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-generic/initscrcomconv.html
-#
-### 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 "$@"