From 3f393db15e4b715ea8f02cf0db11a5c4cac15db0 Mon Sep 17 00:00:00 2001 From: dgsga <181612+dgsga@users.noreply.github.com> Date: Mon, 1 Jul 2024 08:35:02 +0100 Subject: [PATCH] Remove obsolete Red Hat Upstart and SuSE SysV init scripts (#1162) --- .github/workflows/build.yml | 10 +- configure.ac | 32 ----- distrib/initscripts/Makefile.am | 56 -------- distrib/initscripts/meson.build | 36 ----- distrib/initscripts/rc.redhat.tmpl | 223 ----------------------------- distrib/initscripts/rc.suse.tmpl | 157 -------------------- doc/manual/compile.xml | 5 +- meson_options.txt | 2 - 8 files changed, 9 insertions(+), 512 deletions(-) delete mode 100644 distrib/initscripts/rc.redhat.tmpl delete mode 100755 distrib/initscripts/rc.suse.tmpl diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6f9a42763b..0a6b7eeeb32 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -247,7 +247,8 @@ jobs: ninja-build \ openldap-devel \ openssl-devel \ - quota-devel + quota-devel \ + systemd - name: Autotools - Bootstrap run: ./bootstrap - name: Autotools - Configure @@ -256,7 +257,7 @@ jobs: --enable-krbV-uam \ --enable-pgp-uam \ --enable-quota \ - --enable-redhat \ + --enable-systemd \ --with-libtirpc \ --with-cracklib=/usr/share/cracklib - name: Autotools - Build @@ -270,9 +271,10 @@ jobs: - name: Meson - Configure run: | meson setup build \ - -Dwith-tests=true \ + -Dwith-init-hooks=false \ + -Dwith-init-style=redhat-systemd \ -Dwith-quota=true \ - -Dwith-init-style=redhat-sysv + -Dwith-tests=true - name: Meson - Build run: meson compile -C build - name: Meson - Tests diff --git a/configure.ac b/configure.ac index 4aeb0c0fdd5..825f673ba6e 100644 --- a/configure.ac +++ b/configure.ac @@ -318,22 +318,6 @@ AC_ARG_ENABLE(locking, ) -AC_ARG_ENABLE(redhat, - [ --enable-redhat use redhat-style sysv (upstart) configuration ],[ - if test "$enableval" = "yes"; then - sysv_style=redhat - fi - AC_MSG_RESULT([enabling redhat-style sysv support]) - ] -) - -AC_ARG_ENABLE(redhat-sysv, - [ --enable-redhat-sysv obsoleted ],[ - echo "ERROR: --enable-redhat-sysv is obsoleted. Use --enable-redhat." - exit 1 - ] -) - AC_ARG_ENABLE(redhat-systemd, [ --enable-redhat-systemd obsoleted ],[ echo "ERROR: --enable-redhat-systemd is obsoleted. Use --enable-systemd." @@ -341,22 +325,6 @@ AC_ARG_ENABLE(redhat-systemd, ] ) -AC_ARG_ENABLE(suse, - [ --enable-suse use suse-style sysv configuration ],[ - if test "$enableval" = "yes"; then - sysv_style=suse - fi - AC_MSG_RESULT([enabling suse-style sysv support]) - ] -) - -AC_ARG_ENABLE(suse-sysv, - [ --enable-suse-sysv obsoleted ],[ - echo "ERROR: --enable-suse-sysv is obsoleted. Use --enable-suse." - exit 1 - ] -) - AC_ARG_ENABLE(suse-systemd, [ --enable-suse-systemd obsoleted ],[ echo "ERROR: --enable-suse-systemd is obsoleted. Use --enable-systemd." diff --git a/distrib/initscripts/Makefile.am b/distrib/initscripts/Makefile.am index 2396f17aa42..1a854d9e1f1 100644 --- a/distrib/initscripts/Makefile.am +++ b/distrib/initscripts/Makefile.am @@ -32,9 +32,7 @@ GENERATED_FILES = \ rc.debian \ rc.openrc \ rc.papd.netbsd \ - rc.redhat \ rc.solaris \ - rc.suse \ rc.timelord.netbsd \ timelord.service @@ -53,9 +51,7 @@ TEMPLATES = \ rc.debian.tmpl \ rc.openrc.tmpl \ rc.papd.netbsd.tmpl \ - rc.redhat.tmpl \ rc.solaris.tmpl \ - rc.suse.tmpl \ rc.timelord.netbsd.tmpl \ timelord.service.tmpl @@ -68,32 +64,6 @@ EXTRA_DIST = $(TEMPLATES) uninstall: uninstall-startup -# -# checking for Red Hat style sysv scripts: -# - -if USE_REDHAT - -sysvdir = /etc/rc.d/init.d -sysv_SCRIPTS = netatalk - -$(sysv_SCRIPTS): rc.redhat - cp -f rc.redhat $(sysv_SCRIPTS) - chmod a+x $(sysv_SCRIPTS) - -install-data-hook: -if USE_INSTALL_PRIVILEGED - -chkconfig --add $(sysv_SCRIPTS) -endif - -uninstall-startup: -if USE_INSTALL_PRIVILEGED - -chkconfig --del $(sysv_SCRIPTS) - rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) -endif - -endif - # # checking for general systemd scripts: # @@ -117,32 +87,6 @@ endif endif -# -# checking for SUSE style sysv scripts: -# - -if USE_SUSE - -sysvdir = /etc/init.d -sysv_SCRIPTS = netatalk - -$(sysv_SCRIPTS): rc.suse - cp -f rc.suse $(sysv_SCRIPTS) - chmod a+x $(sysv_SCRIPTS) - -install-data-hook: -if USE_INSTALL_PRIVILEGED - -insserv $(sysv_SCRIPTS) -endif - -uninstall-startup: -if USE_INSTALL_PRIVILEGED - -insserv -d $(sysv_SCRIPTS) - rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) -endif - -endif - # # checking for NetBSD init scripts # diff --git a/distrib/initscripts/meson.build b/distrib/initscripts/meson.build index 1c323bd0017..48a280e10b3 100644 --- a/distrib/initscripts/meson.build +++ b/distrib/initscripts/meson.build @@ -54,42 +54,6 @@ elif get_option('with-init-style') == 'debian-sysv' '10', ) endif -elif get_option('with-init-style') == 'redhat-sysv' - init_dir += '/etc/rc.d/init.d' - custom_target( - 'redhat', - input: 'rc.redhat.tmpl', - output: 'netatalk', - command: sed_command, - capture: true, - install: true, - install_dir: init_dir, - install_mode: 'rwxr-xr-x', - ) - if get_option('with-init-hooks') - meson.add_install_script( - find_program('chkconfig'), - '--add', '/etc/rc.d/init.d/netatalk', - ) - endif -elif get_option('with-init-style') == 'suse-sysv' - init_dir += '/etc/init.d' - custom_target( - 'suse_sysv', - input: 'rc.suse.tmpl', - output: 'netatalk', - command: sed_command, - capture: true, - install: true, - install_dir: init_dir, - install_mode: 'rwxr-xr-x', - ) - if get_option('with-init-hooks') - meson.add_install_script( - find_program('insserv'), - '/etc/init.d/netatalk', - ) - endif elif get_option('with-init-style') == 'netbsd' init_dir += '/etc/rc.d' rc_scripts = [ diff --git a/distrib/initscripts/rc.redhat.tmpl b/distrib/initscripts/rc.redhat.tmpl deleted file mode 100644 index cb17b279ba7..00000000000 --- a/distrib/initscripts/rc.redhat.tmpl +++ /dev/null @@ -1,223 +0,0 @@ -#! /bin/sh -# chkconfig: - 91 35 -# description: This package is an implementation of "AFP over TCP" -# and provides printer, file sharing, and routing -# services via legacy AppleTalk networking protocol. -# -# Netatalk :NETATALK_VERSION: daemons. -# If you use AppleTalk, Make sure not to start atalkd in the background: -# its data structures must have time to stablize before running the -# other processes. - -ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1` -ATALK_BIN=:BINDIR: -ATALK_CONF_DIR=:ETCDIR: -ATALK_SBIN=:SBINDIR: - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# read in netatalk configuration -if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then - . ${ATALK_CONF_DIR}/netatalk.conf -fi - -# initialize return values -RETVAL=1 -RETVAL_ATALKD=0 -RETVAL_PAPD=0 -RETVAL_CNID_METAD=0 -RETVAL_AFPD=0 - -# startup code for everything -atalk_startup() { - # Check that networking is up. - if [ ${NETWORKING} = "no" ]; then - echo "[Network isn't started]"; - exit 1; - fi - - if [ ! -f ${ATALK_CONF_DIR}/netatalk.conf ]; then - echo "[${ATALK_CONF_DIR}/netatalk.conf not found]"; - exit 6; - fi - - if [ x"${ATALKD_RUN}" != x"no" -a -x ${ATALK_SBIN}/atalkd ]; then - # Quickly probe for appletalk and warn if we can't find it - #/sbin/modprobe appletalk || echo "[could not load appletalk module]" - # Check for IP Encapsulation support - #/sbin/modprobe ipddp || echo "[could not load IP encapsulation]" - echo -n " Starting atalkd:" - daemon ${ATALK_SBIN}/atalkd - RETVAL_ATALKD=$? - echo - - if [ -x ${ATALK_BIN}/nbprgstr ]; then - action " Registering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" ${ATALK_BIN}/nbprgstr -p 4 \"${ATALK_NAME}:Workstation${ATALK_ZONE}\" - action " Registering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" ${ATALK_BIN}/nbprgstr -p 4 \"${ATALK_NAME}:netatalk${ATALK_ZONE}\" - fi - - if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then - echo -n " Starting papd:" - daemon ${ATALK_SBIN}/papd - RETVAL_PAPD=$? - echo - fi - - # check for timelord in bin directory - if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then - echo -n " Starting timelord" - daemon ${ATALK_BIN}/timelord - echo - fi - - # check for timelord in sbin directory - if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then - echo -n " Starting timelord" - daemon ${ATALK_SBIN}/timelord - echo - fi - - # check for a2boot in bin directory - if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then - echo -n " Starting a2boot" - daemon ${ATALK_BIN}/a2boot - echo - fi - - # check for a2boot in sbin directory - if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then - echo -n " Starting a2boot" - daemon ${ATALK_SBIN}/a2boot - echo - fi - - fi - - if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ] ; then - echo -n " Starting cnid_metad:" - daemon ${ATALK_SBIN}/cnid_metad $CNID_CONFIG - RETVAL_CNID_METAD=$? - echo - fi - - if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ] ; then - echo -n " Starting afpd:" - daemon ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ - -c ${AFPD_MAX_CLIENTS} -n \"${ATALK_NAME}${ATALK_ZONE}\" - RETVAL_AFPD=$? - echo - fi - - if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_CNID_METAD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then - RETVAL=0 - touch /var/lock/subsys/atalk || RETVAL=1 - fi -} - -case "$1" in -'start') - echo -n 'Starting Netatalk services: ' - if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then - echo -n "(backgrounded)" - atalk_startup >& /dev/null & - else - echo - atalk_startup - fi - echo - ;; -'stop') - echo 'Shutting down Netatalk services: ' - if [ x"${ATALKD_RUN}" != x"no" ]; then - if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then - echo -n " Stopping papd:" - killproc papd - RETVAL_PAPD=$? - echo - fi - - # checking for timelord in bin directory - if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then - echo -n " Stopping timelord:" - killproc timelord - echo - fi - - # checking for timelord in sbin directory - if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then - echo -n " Stopping timelord:" - killproc timelord - echo - fi - - # checking for a2boot in bin directory - if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then - echo -n " Stopping a2boot:" - killproc a2boot - echo - fi - - # checking for a2boot in sbin directory - if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then - echo -n " Stopping a2boot:" - killproc a2boot - echo - fi - - action " Unregistering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" ${ATALK_BIN}/nbpunrgstr \"${ATALK_NAME}:Workstation${ATALK_ZONE}\" - action " Unregistering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" ${ATALK_BIN}/nbpunrgstr \"${ATALK_NAME}:netatalk${ATALK_ZONE}\" - - # kill atalkd last, since without it the plumbing goes away. - if [ -x ${ATALK_SBIN}/atalkd ]; then - echo -n " Stopping atalk:" - killproc atalkd - RETVAL_ATALKD=$? - echo - fi - fi - - # kill this separately as we also do AFP/tcp - if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then - echo -n " Stopping afpd:" - killproc afpd - RETVAL_AFPD=$? - echo - fi - - if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ]; then - echo -n " Stopping cnid_metad:" - killproc cnid_metad - RETVAL_CNID_METAD=$? - echo - fi - - if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then - RETVAL=0 - rm -f /var/lock/subsys/atalk || RETVAL=1 - fi - echo "" - ;; - 'restart'|'reload') - $0 stop - $0 start - RETVAL=$? - ;; - 'status') - status atalkd - status papd - status timelord - status a2boot - status cnid_metad - status afpd - RETVAL=$? - ;; - *) - echo "Usage: $0 {start|stop|restart|reload|status}" - exit 2 -esac - -exit $RETVAL diff --git a/distrib/initscripts/rc.suse.tmpl b/distrib/initscripts/rc.suse.tmpl deleted file mode 100755 index 47e15c09b73..00000000000 --- a/distrib/initscripts/rc.suse.tmpl +++ /dev/null @@ -1,157 +0,0 @@ -#! /bin/sh -# Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany. All rights reserved. -# -# Author: -# Reinhold Sojer, -# Olaf Hering, -# -### BEGIN INIT INFO -# Provides: netatalk -# Required-Start: $local_fs -# Required-Stop: $local_fs -# Should-Start: $network $named $remote_fs $syslog slpd avahi-daemon -# Should-Stop: $remote_fs $network $syslog -# Default-Start: 3 5 -# Default-Stop: -# Description: AFP over TCP and legacy AppleTalk daemons -### END INIT INFO - -# Netatalk :NETATALK_VERSION: - -ATALK_NAME=`hostname|sed 's/\..*$//'` - -. /etc/rc.status -. :ETCDIR:/netatalk.conf - -# startup code for everything -atalk_startup() { - if [ x"${ATALKD_RUN}" != x"no" ]; then - echo -n " Starting atalkd ... " - :SBINDIR:/atalkd ; my_ec=$? - - if [ -x :BINDIR:/nbprgstr -a "$my_ec" = "0" ]; then - echo -n ".. " - :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation - echo -n ". " - :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk - fi - if [ "$my_ec" != "0" ] ; then false ; fi - rc_status -v - - rc_reset - - if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then - echo -n " Starting papd" - :SBINDIR:/papd - rc_status -v - fi - - rc_reset - - if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ]; then - echo -n " Starting timelord" - :SBINDIR:/timelord - rc_status -v - fi - - rc_reset - - if [ x"${A2BOOT_RUN}" = x"yes" -a -x :SBINDIR:/a2boot ]; then - echo -n " Starting a2boot" - :SBINDIR:/a2boot - rc_status -v - fi - - rc_reset - - fi - - if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then - echo -n " Starting cnid_metad " - startproc :SBINDIR:/cnid_metad ${CNID_CONFIG} - rc_status -v - fi - - if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then - echo -n " Starting afpd (" - echo -n ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ - -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE} - echo -n ")" - startproc :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ - ${AFPD_OPTIONS} \ - -c ${AFPD_MAX_CLIENTS} -n "${ATALK_NAME}${ATALK_ZONE}" - rc_status -v - fi - - touch /var/lock/subsys/atalk -} - -case "$1" in - start) - if test ! -z "$UID" -a "$UID" != 0 ; then - echo "you have to be root to start netatalk daemons" - rc_failed - else - if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then - echo -n "Starting netatalk in the background ..." - atalk_startup >& /dev/null & - rc_status -v - else - echo "Starting netatalk (this may take a while) ..." - atalk_startup - fi - fi - ;; - stop) - echo -n "Shutting down netatalk" - if test -x :SBINDIR:/papd ; then - killproc -TERM :SBINDIR:/papd - fi - if test -x :SBINDIR:/timelord ; then - killproc -TERM :SBINDIR:/timelord - fi - if test -x :SBINDIR:/a2boot ; then - killproc -TERM :SBINDIR:/a2boot - fi - if test -x :SBINDIR:/atalkd ; then - killproc -TERM :SBINDIR:/atalkd - fi - killproc -TERM :SBINDIR:/cnid_metad - killproc -TERM :SBINDIR:/afpd - - rc_status -v - ;; - restart|reload|force-reload) - $0 stop - $0 start - rc_status - ;; - status) - echo "Checking for netatalk services" - if [ x"${ATALKD_RUN}" = x"yes" -a -x :SBINDIR:/atalkd ] ; then - checkproc :SBINDIR:/atalkd && echo -n "atalkd: OK " || echo -n "atalkd: No process " - fi - if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ] ; then - checkproc :SBINDIR:/papd && echo -n "papd: OK " || echo -n "papd: No process " - fi - if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ] ; then - checkproc :SBINDIR:/timelord && echo -n " timelord: OK " || echo -n " timelord: No process " - fi - if [ x"${A2BOOT_RUN}" = x"yes" -a -x :SBINDIR:/a2boot ] ; then - checkproc :SBINDIR:/a2boot && echo -n " a2boot: OK " || echo -n " a2boot: No process " - fi - if [ x"${CNID_METAD_RUN}" = x"yes" ] ; then - checkproc :SBINDIR:/cnid_metad && echo -n " cnid_metad: OK " || echo -n " cnid_metad: No process " - fi - checkproc :SBINDIR:/afpd && echo "afpd: OK" || echo "afpd: No process" - # assume that afpd is the "main" process ... - checkproc :SBINDIR:/afpd - rc_status -v - ;; - *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; -esac - -rc_exit diff --git a/doc/manual/compile.xml b/doc/manual/compile.xml index 8de54d0ab7d..b36fc30eafa 100644 --- a/doc/manual/compile.xml +++ b/doc/manual/compile.xml @@ -282,7 +282,8 @@ xsltproc ninja-build \ openldap-devel \ openssl-devel \ - quota-devel + quota-devel \ + systemd Autotools - Bootstrap @@ -321,7 +322,7 @@ xsltproc meson setup build \ -Dwith-tests=true \ -Dwith-quota=true \ - -Dwith-init-style=redhat-sysv + -Dwith-init-style=redhat-systemd Meson - Build diff --git a/meson_options.txt b/meson_options.txt index 0433a541429..a7ff394b374 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -277,10 +277,8 @@ option( 'netbsd', 'openrc', 'redhat-systemd', - 'redhat-sysv', 'solaris', 'suse-systemd', - 'suse-sysv', 'systemd', ], value: 'none',