ganglia/monitor-core — pull request #139 by olahaye74 (2014-02-27 19:23:10+00:00)
Title: systemd packaing support (rpm). (following my message in the mailing list).

List of fixes and explanations: (there are also some comments for each commits)
1/ specfile.in:
- It adds support for systemd (supports both initscripts and systemd)
- It fixes build that tries to package the web interface which is now splitted of the ganglia-core.
- Add missing ck-devel build require.

2/ gmetad.service.in and gmond.service.in
1/ gmtad doesn't recognize the -f option
2/ missing Type= fork
3/ missing EnvironmentFile= (behaviour would be different from init script if /etc/sysconfig/gmetad file was not sourced)
4/ missing --pid-file option and no PidFile= in service file.
5/ User=ganglia is wrong as if gmetad starts as user ganglia (provided it exists in the systems), then it fails to setuid to user configured in gmetad.conf.....which is by default nobody.... => remove the User and let gmetad setuid to the user specified in the config file.

Note: Those files need @runstatedir@ => /var/run or /run and @envdir@ => /etcf/sysconfig on redhat clones and /etc/default on deb variants.

In order to correctly fix the above files, we need to fix scripts/fixconfig.in to add runstatedir and envdir.
I'm not happy with this patch as I think that this should got to configure.ac (unfornutately out of my skill). Using configure.ac would permit to define variables --runstatedir (autoconf starting at version 2.70 supports that by default) and --envdir from the command line. It would also simplify fixconfig.in (the test between /etc/sysconfig and /etc/defaults wouldn't be needed in fixconfig.in). So feel free to enhance this.
@runstatedir@ should point to /var/run (autoconf 2.70+ uses this as default)
@envdir@ should point to /etc/sysconfig on a redhat clone and /etc/defaults on a debian variant.

Once applied, the configure line in the spec.in file could be enhanced by adding --runstatedir=/var/run --envdir=/etc/sysconfig (not in this commit)

4/ It seems that now the CK package is required. (searching for ck on google was hard)
Thus the INSTALL file is updated accordingly.