Bug 1385249 - /etc/sysconfig is redhat specific and does not exist in debian or arch
Summary: /etc/sysconfig is redhat specific and does not exist in debian or arch
Keywords:
Status: NEW
Alias: None
Product: GlusterFS
Classification: Community
Component: build
Version: mainline
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Kaleb KEITHLEY
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-15 16:05 UTC by Joe Julian
Modified: 2019-08-31 17:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Joe Julian 2016-10-15 16:05:57 UTC
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

Comment 1 Amar Tumballi 2019-06-17 04:57:51 UTC
I see that sysconfig dir is now used only in glusterfs.spec file. Should this issue be closed?

Comment 2 Kaleb KEITHLEY 2019-06-17 11:31:21 UTC
(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.


Note You need to log in before you can comment on or make changes to this bug.