* How to make systemd unit files work in all supported distros?
@ 2016-02-08 9:44 Nathan Cutler
2016-02-08 13:30 ` Sage Weil
2016-02-08 22:55 ` Ken Dreyer
0 siblings, 2 replies; 6+ messages in thread
From: Nathan Cutler @ 2016-02-08 9:44 UTC (permalink / raw)
To: Ceph Development
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to make systemd unit files work in all supported distros?
2016-02-08 9:44 How to make systemd unit files work in all supported distros? Nathan Cutler
@ 2016-02-08 13:30 ` Sage Weil
2016-02-08 22:51 ` Nathan Cutler
2016-02-08 22:55 ` Ken Dreyer
1 sibling, 1 reply; 6+ messages in thread
From: Sage Weil @ 2016-02-08 13:30 UTC (permalink / raw)
To: Nathan Cutler; +Cc: Ceph Development
On Mon, 8 Feb 2016, Nathan Cutler wrote:
> 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.)
If (1) isn't enough to get us by, then I agree that (3) seems to be the
cleanest. But autoconf/automake at least should be able to feed these
paths into the .in file without needed ceph-detect-init, right? Which
paths are you having problems with?
sage
>
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to make systemd unit files work in all supported distros?
2016-02-08 13:30 ` Sage Weil
@ 2016-02-08 22:51 ` Nathan Cutler
0 siblings, 0 replies; 6+ messages in thread
From: Nathan Cutler @ 2016-02-08 22:51 UTC (permalink / raw)
To: Sage Weil; +Cc: Ceph Development
On 02/08/2016 02:30 PM, Sage Weil wrote:
> On Mon, 8 Feb 2016, Nathan Cutler wrote:
>> 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.)
>
> If (1) isn't enough to get us by, then I agree that (3) seems to be the
> cleanest. But autoconf/automake at least should be able to feed these
> paths into the .in file without needed ceph-detect-init, right? Which
> paths are you having problems with?
(1) is indeed tempting as a quick fix. But we still have at least one
problematic path - the /usr/sbin/ceph-disk in:
https://github.com/ceph/ceph/blob/master/systemd/ceph-disk%40.service#L7
Because on SUSE ceph-disk is installed in /usr/bin.
(As for (3), I guess you're right that autoconf would be able to figure
out the paths.)
Thanks
--
Nathan Cutler
Software Engineer Distributed Storage
SUSE LINUX, s.r.o.
Tel.: +420 284 084 037
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to make systemd unit files work in all supported distros?
2016-02-08 9:44 How to make systemd unit files work in all supported distros? Nathan Cutler
2016-02-08 13:30 ` Sage Weil
@ 2016-02-08 22:55 ` Ken Dreyer
2016-02-08 23:14 ` Nathan Cutler
1 sibling, 1 reply; 6+ messages in thread
From: Ken Dreyer @ 2016-02-08 22:55 UTC (permalink / raw)
To: Nathan Cutler; +Cc: Ceph Development
Which executables are different? Fedora's pretty flexible about this;
I'm sure we could ship ceph-disk in /usr/bin if it lets us align with
SUSE or whatever.
- Ken
On Mon, Feb 8, 2016 at 2:44 AM, Nathan Cutler <ncutler@suse.cz> wrote:
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to make systemd unit files work in all supported distros?
2016-02-08 22:55 ` Ken Dreyer
@ 2016-02-08 23:14 ` Nathan Cutler
2016-02-09 4:10 ` Ken Dreyer
0 siblings, 1 reply; 6+ messages in thread
From: Nathan Cutler @ 2016-02-08 23:14 UTC (permalink / raw)
To: Ken Dreyer; +Cc: Ceph Development
On 02/08/2016 11:55 PM, Ken Dreyer wrote:
> Which executables are different? Fedora's pretty flexible about this;
> I'm sure we could ship ceph-disk in /usr/bin if it lets us align with
> SUSE or whatever.
Here's another one:
https://github.com/ceph/ceph/blob/master/systemd/ceph-osd%40.service#L13
%{_libexecdir} expands to /usr/lib on SUSE :-(
And "sh -c" would not help us here, either.
> On Mon, Feb 8, 2016 at 2:44 AM, Nathan Cutler <ncutler@suse.cz> wrote:
>> 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
>> --
>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Nathan Cutler
Software Engineer Distributed Storage
SUSE LINUX, s.r.o.
Tel.: +420 284 084 037
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-02-09 4:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-08 9:44 How to make systemd unit files work in all supported distros? Nathan Cutler
2016-02-08 13:30 ` 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
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.