From: Nathan Cutler <ncutler@suse.cz>
To: Ceph Development <ceph-devel@vger.kernel.org>
Subject: How to make systemd unit files work in all supported distros?
Date: Mon, 8 Feb 2016 10:44:18 +0100 [thread overview]
Message-ID: <56B86372.4020600@suse.cz> (raw)
In master we currently have an issue with the systemd unit files in that
they contain hard-coded paths that are specific to RH/CentOS/Fedora.
Other distros can and do have the executables in different places.
I opened a bug[1] for this, but before I go off trying to fix it I would
like to solicit your feedback on the following possible approaches I
came up with (and/or "turn me on" to a different approach):
(1) Rely on PATH. Basically, instead of running executables directly,
run them by "/bin/sh -c", which summons the system PATH to help find the
executables. See https://github.com/ceph/ceph/pull/6803 for an example
of this.
(2) Set environment variables in /etc/sysconfig/ceph. Systemd has an
EnvironmentFile directive which reads environment variables from a file.
If this were pointed to /etc/sysconfig/ceph (as it is in several unit
files already), we could set the distro-specific parts of the paths
there and write the paths similar to how we do it in the spec file.
(3) Generate unit files at build time. In this approach, the unit files
would exist in the source tree as templates (e.g. ceph-osd@.service.in)
and these would get transformed into the "real" unit files at build
time. The ceph-detect-init utility could be used to determine the distro
and the Makefile logic would then fill in the templates as needed for
the distro.
Of these three approaches, only (3) would seem to be general enough to
work nicely for all distros. (For example, EnvironmentFile will need to
be set to /etc/default/ceph on Debianesque systems and there is no
obvious way to set *this* path as an environment variable.)
Any thoughts on this? Thanks in advance!
[1] http://tracker.ceph.com/issues/14687
--
Nathan Cutler
Software Engineer Distributed Storage
SUSE LINUX, s.r.o.
Tel.: +420 284 084 037
next reply other threads:[~2016-02-08 9:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 9:44 Nathan Cutler [this message]
2016-02-08 13:30 ` How to make systemd unit files work in all supported distros? Sage Weil
2016-02-08 22:51 ` Nathan Cutler
2016-02-08 22:55 ` Ken Dreyer
2016-02-08 23:14 ` Nathan Cutler
2016-02-09 4:10 ` Ken Dreyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56B86372.4020600@suse.cz \
--to=ncutler@suse.cz \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.