From 8ba2fce04e6a86ec350b7e083745fdc1d7f1dcdf Mon Sep 17 00:00:00 2001 From: HAT Date: Fri, 26 Aug 2011 01:43:47 +0900 Subject: [PATCH] new configure option "--enable-redhat-systemd" for Fedora15 and later. "--enable-redhat" is renamed "--enable-redhat-sysv". suggested by netatalk-2.2.0-4.fc17.src.rpm --- NEWS | 29 +++++--- configure.in | 25 ++++++- distrib/initscripts/.gitignore | 4 +- distrib/initscripts/Makefile.am | 50 +++++++++++-- .../initscripts/rc.atalk.redhat-systemd.tmpl | 73 +++++++++++++++++++ ....redhat.tmpl => rc.atalk.redhat-sysv.tmpl} | 0 .../service.atalk.redhat-systemd.tmpl | 13 ++++ 7 files changed, 169 insertions(+), 25 deletions(-) create mode 100644 distrib/initscripts/rc.atalk.redhat-systemd.tmpl rename distrib/initscripts/{rc.atalk.redhat.tmpl => rc.atalk.redhat-sysv.tmpl} (100%) create mode 100644 distrib/initscripts/service.atalk.redhat-systemd.tmpl diff --git a/NEWS b/NEWS index dcfe798c..b6b387c4 100644 --- a/NEWS +++ b/NEWS @@ -3,9 +3,12 @@ Changes in 2.2.1 * NEW: afpd: disable continous service feature by default, new option -keepsessions to enable it -* UPD: afpd: Enhance ACL support detection for volumes: enable them per volume if - 1) ACL support compiled in, 2) the volume supports ACLs, 3) the new volume - option "noacls" is not set for the volume. +* NEW: configure option "--enable-redhat-systemd" for Fedora15 and later. + "--enable-redhat" is renamed "--enable-redhat-sysv". +* UPD: afpd: Enhance ACL support detection for volumes: enable them per volume + if + 1) ACL support compiled in, 2) the volume supports ACLs, 3) the new + volume option "noacls" is not set for the volume. The previous behaviour was to enable ACL support for a volume if 1) it was compiled in and 2) the volume supported ACLs. There was no way to disable ACLs for a volume. @@ -24,13 +27,13 @@ Changes in 2.2.1 * FIX: afpd: fix a crash when searching for a UUID that is not a special local UUID and LDAP support is not compiled in * FIX: afpd: .volinfo file not created on first volume access if user in rolist -* FIX: afpd: possible crash at startup when registering with Avahi when Avahi is - not running +* FIX: afpd: possible crash at startup when registering with Avahi + when Avahi is not running * FIX: afpd: return correct user/group type when mapping UUIDs to names -* FIX: afpd: for directories add DARWIN_ACE_DELETE ACE if DARWIN_ACE_ADD_SUBDIRECTORY - is set -* FIX: afpd: afpd crashed when it failed to register with Avahi because eg user - service registration is disabled in the Avahi config +* FIX: afpd: for directories add DARWIN_ACE_DELETE ACE + if DARWIN_ACE_ADD_SUBDIRECTORY is set +* FIX: afpd: afpd crashed when it failed to register with Avahi because eg + user service registration is disabled in the Avahi config * FIX: cnid_dbd: increase BerkeleyDB locks and lockobjs * FIX: cnid_dbd: implement -d option, deletes CNID db * FIX: dbd: better detection of local (or SMB/NFS) modifications on AFP volumes @@ -38,12 +41,13 @@ Changes in 2.2.1 * FIX: Sourcecode distribution: add missing headers * FIX: Solaris 10: missing dirfd replacement function * FIX: case-conversion of surrogate pair -* FIX: Compilation error on GNU/kFreeBSD, fixes Bug ID 3392794 and Debian #630349 +* FIX: Compilation error on GNU/kFreeBSD, fixes Bug ID 3392794 and + Debian #630349 * FIX: Fix Debian Bug#637025 * FIX: Multiple *BSD compilation compatibility fixes, Bug ID 3380785 * FIX: precompose_w() failed if tail character is decomposed surrogate pair -Changes in 2.2 +Changes in 2.2.0 ============== * NEW: afpd: new volume option "nonetids" @@ -63,7 +67,8 @@ Changes in 2.2 * FIX: afpd: new catsearch was broken * FIX: afpd: only use volume UUIDs in master afpd * FIX: dbd: Multiple fixes, reliable locking -* FIX: ad file suite: fix an error that resulted in CNID database inconsistencies +* FIX: ad file suite: fix an error that resulted in CNID database + inconsistencies Changes in 2.2beta4 =================== diff --git a/configure.in b/configure.in index 7c939c20..d78cfa51 100644 --- a/configure.in +++ b/configure.in @@ -385,16 +385,32 @@ AC_ARG_ENABLE(locking, ) - AC_ARG_ENABLE(redhat, - [ --enable-redhat use redhat-style sysv configuration ],[ + [ --enable-redhat obsoleted ],[ + echo "ERROR: --enable-redhat is obsoleted. Use --enable-redhat-sysv or --enable-redhat-systemd." + echo "exit 1" + exit 1 + ] +) + +AC_ARG_ENABLE(redhat-sysv, + [ --enable-redhat-sysv use redhat-style sysv (upstart) configuration ],[ if test "$enableval" = "yes"; then - sysv_style=redhat + sysv_style=redhat-sysv fi AC_MSG_RESULT([enabling redhat-style sysv support]) ] ) +AC_ARG_ENABLE(redhat-systemd, + [ --enable-redhat-systemd use redhat-style systemd (>=Fedora15) configuration ],[ + if test "$enableval" = "yes"; then + sysv_style=redhat-systemd + fi + AC_MSG_RESULT([enabling redhat-style systemd support]) + ] +) + AC_ARG_ENABLE(suse, [ --enable-suse use suse-style sysv configuration ],[ if test "$enableval" = "yes"; then @@ -1261,7 +1277,8 @@ AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes) AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes) AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes) AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd) -AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat) +AM_CONDITIONAL(USE_REDHAT_SYSV, test x$sysv_style = xredhat-sysv) +AM_CONDITIONAL(USE_REDHAT_SYSTEMD, test x$sysv_style = xredhat-systemd) AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse) AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes) AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64) diff --git a/distrib/initscripts/.gitignore b/distrib/initscripts/.gitignore index 3ed4c80c..af1675fd 100644 --- a/distrib/initscripts/.gitignore +++ b/distrib/initscripts/.gitignore @@ -1,10 +1,12 @@ Makefile Makefile.in rc.atalk.bsd -rc.atalk.redhat +rc.atalk.redhat-sysv +rc.atalk.redhat-systemd rc.atalk.suse rc.atalk.tru64 rc.atalk.sysv +service.atalk.redhat-systemd netatalk atalk .gitignore diff --git a/distrib/initscripts/Makefile.am b/distrib/initscripts/Makefile.am index 833b0872..3ff9246b 100644 --- a/distrib/initscripts/Makefile.am +++ b/distrib/initscripts/Makefile.am @@ -12,11 +12,13 @@ pkgconfdir = @PKGCONFDIR@ sed -e s@:BINDIR:@${bindir}@ \ -e s@:SBINDIR:@${sbindir}@ \ -e s@:ETCDIR:@${pkgconfdir}@ \ + -e s@:PKGLIBEXECDIR:@${pkglibexecdir}@ \ <$< >$@ GENERATED_FILES = \ rc.afpd.netbsd \ - rc.atalk.redhat \ + rc.atalk.redhat-sysv \ + rc.atalk.redhat-systemd \ rc.atalk.tru64 \ rc.atalk.bsd \ rc.atalkd.netbsd \ @@ -26,11 +28,13 @@ GENERATED_FILES = \ rc.timelord.netbsd \ rc.atalk.sysv \ rc.atalk.gentoo \ - rc.atalk.debian + rc.atalk.debian \ + service.atalk.redhat-systemd TEMPLATES = \ rc.afpd.netbsd.tmpl \ - rc.atalk.redhat.tmpl \ + rc.atalk.redhat-sysv.tmpl \ + rc.atalk.redhat-systemd.tmpl \ rc.atalk.tru64.tmpl \ rc.atalk.bsd.tmpl \ rc.atalkd.netbsd.tmpl \ @@ -40,9 +44,10 @@ TEMPLATES = \ rc.timelord.netbsd.tmpl \ rc.atalk.sysv.tmpl \ rc.atalk.gentoo.tmpl \ - rc.atalk.debian.tmpl + rc.atalk.debian.tmpl \ + service.atalk.redhat-systemd.tmpl -CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) afpd atalkd cnid_metad papd timelord +CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) $(service_DATA) afpd atalkd cnid_metad papd timelord EXTRA_DIST = $(TEMPLATES) # overwrite automake uninstall @@ -55,13 +60,13 @@ uninstall: uninstall-startup # checking for "redhat" style sysv scripts: # -if USE_REDHAT +if USE_REDHAT_SYSV sysvdir = /etc/rc.d/init.d sysv_SCRIPTS = netatalk -$(sysv_SCRIPTS): rc.atalk.redhat - cp -f rc.atalk.redhat $(sysv_SCRIPTS) +$(sysv_SCRIPTS): rc.atalk.redhat-sysv + cp -f rc.atalk.redhat-sysv $(sysv_SCRIPTS) chmod a+x $(sysv_SCRIPTS) install-data-hook: @@ -73,6 +78,35 @@ uninstall-startup: endif +# +# checking for "redhat" style systemd scripts: +# + +if USE_REDHAT_SYSTEMD + +sysvdir = $(pkglibexecdir) +sysv_SCRIPTS = netatalk.sh + +servicedir = /lib/systemd/system +service_DATA = netatalk.service + +$(sysv_SCRIPTS): rc.atalk.redhat-systemd + cp -f rc.atalk.redhat-systemd $(sysv_SCRIPTS) + chmod a+x $(sysv_SCRIPTS) + +$(service_DATA): service.atalk.redhat-systemd + cp -f service.atalk.redhat-systemd $(service_DATA) + +install-data-hook: + -systemctl enable $(sysv_SCRIPTS) + +uninstall-startup: + -systemctl disable $(sysv_SCRIPTS) + rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) \ + $(DESTDIR)$(servicedir)/$(service_DATA) + +endif + # # checking for "SuSE" style sysv scripts: # diff --git a/distrib/initscripts/rc.atalk.redhat-systemd.tmpl b/distrib/initscripts/rc.atalk.redhat-systemd.tmpl new file mode 100644 index 00000000..e05972b3 --- /dev/null +++ b/distrib/initscripts/rc.atalk.redhat-systemd.tmpl @@ -0,0 +1,73 @@ +#!/bin/sh + +# Netatalk daemons. + +ATALK_BIN=:BINDIR: +ATALK_CONF_DIR=:ETCDIR: +ATALK_SBIN=:SBINDIR: + +# default +ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1` +ATALK_UNIX_CHARSET='LOCALE' +ATALK_MAC_CHARSET='MAC_ROMAN' + +CNID_METAD_RUN=yes +AFPD_RUN=yes +AFPD_MAX_CLIENTS=20 +AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" +AFPD_GUEST=nobody +CNID_CONFIG="-l log_note" + +ATALKD_RUN=no +PAPD_RUN=no +TIMELORD_RUN=no +A2BOOT_RUN=no +ATALK_ZONE= +ATALK_BGROUND=no + +# read in netatalk configuration +if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then + . ${ATALK_CONF_DIR}/netatalk.conf +fi + +if [ x"${ATALKD_RUN}" != x"no" -a -x ${ATALK_SBIN}/atalkd ]; then + ${ATALK_SBIN}/atalkd + + if [ -x ${ATALK_BIN}/nbprgstr ]; then + ${ATALK_BIN}/nbprgstr -p 4 ${ATALK_NAME}:Workstation${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 + ${ATALK_SBIN}/papd + fi + + # check for timelord in bin directory + if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_BIN}/timelord ]; then + ${ATALK_BIN}/timelord + fi + + # check for timelord in sbin directory + if [ x"${TIMELORD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/timelord ]; then + ${ATALK_SBIN}/timelord + fi + + # check for a2boot in bin directory + if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then + ${ATALK_BIN}/a2boot + fi + + # check for a2boot in sbin directory + if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then + ${ATALK_SBIN}/a2boot + fi +fi + +if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ]; then + ${ATALK_SBIN}/cnid_metad $CNID_CONFIG +fi + +if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ]; then + ${ATALK_SBIN}/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ + -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE} +fi diff --git a/distrib/initscripts/rc.atalk.redhat.tmpl b/distrib/initscripts/rc.atalk.redhat-sysv.tmpl similarity index 100% rename from distrib/initscripts/rc.atalk.redhat.tmpl rename to distrib/initscripts/rc.atalk.redhat-sysv.tmpl diff --git a/distrib/initscripts/service.atalk.redhat-systemd.tmpl b/distrib/initscripts/service.atalk.redhat-systemd.tmpl new file mode 100644 index 00000000..57316299 --- /dev/null +++ b/distrib/initscripts/service.atalk.redhat-systemd.tmpl @@ -0,0 +1,13 @@ +# netatalk service file for systemd + +[Unit] +Description=File and Printer sharing for Macintosh clients +After=syslog.target network.target + +[Service] +Type=oneshot +ExecStart=/bin/bash -c "exec :PKGLIBEXECDIR:/netatalk.sh" +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target -- 2.39.2