I propose a solution like this but there are several other places /etc/sysconfig are used that are either not processed by configure or probably doesn't really matter. diff --git a/configure.ac b/configure.ac index 8aa07ff..7bd00de 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,19 @@ AM_INIT_AUTOMAKE(tar-pax) #but libglusterfs fails to build with contrib (Then are not set up that way?) #AM_INIT_AUTOMAKE([subdir-objects]) +AC_ARG_VAR(initconfdir, [directory for initscripts configuration, if enabled]) + +# Try to detect the appropriate conf dir. Several systems have both /etc/default +# and /etc/sysconfig but latter is always primary. +if test "x$do_initscripts" = xyes; then +if test "x$initconfdir" = x; then +AC_CHECK_FILE(/etc/conf.d, [initconfdir='$(sysconfdir)/conf.d}'], [# Gentoo/Arch +AC_CHECK_FILE(/etc/sysconfig, [initconfdir='$(sysconfdir)/sysconfig'], [# RedHat/Fedora/Slax/Mandriva/S +AC_CHECK_FILE(/etc/default, [initconfdir='$(sysconfdir)/default'], [# Debian/Ubuntu +AC_MSG_ERROR([could not determine system initscripts config dir; please set initconfdir manually.])])]) +fi +fi + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) if make --help 2>&1 | grep -q no-print-directory; then diff --git a/extras/systemd/glusterd.service.in b/extras/systemd/glusterd.service.in index 26694cf..40a2928 100644 --- a/extras/systemd/glusterd.service.in +++ b/extras/systemd/glusterd.service.in @@ -9,7 +9,7 @@ Type=forking PIDFile=@localstatedir@/run/glusterd.pid LimitNOFILE=65536 Environment="LOG_LEVEL=INFO" -EnvironmentFile=-@sysconfdir@/sysconfig/glusterd +EnvironmentFile=-@initconfdir@/glusterd ExecStart=@prefix@/sbin/glusterd -p @localstatedir@/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_ KillMode=process
I see that sysconfig dir is now used only in glusterfs.spec file. Should this issue be closed?
(In reply to Amar Tumballi from comment #1) > I see that sysconfig dir is now used only in glusterfs.spec file. Should > this issue be closed? It's still wrong in the glusterd.service(.in) file, so probably not. the glusterd.service(.in) on debian/ubuntu/arch is modified during .deb package building. (E.g. line 31 of https://github.com/gluster/glusterfs-debian/blob/bionic-glusterfs-6/debian/rules) That's fine for people that install from .deb packages. But anyone who just builds+installs from source will have a broken glusterd.service file. It would be better to really fix it (in autoconf/configure) and then the package build edit step can be removed.
This bug is moved to https://github.com/gluster/glusterfs/issues/940, and will be tracked there from now on. Visit GitHub issues URL for further details