[systemd-devel] Requiring hardware device and escaping device names

Lennart Poettering lennart at poettering.net
Wed Apr 23 14:22:18 PDT 2014


On Wed, 26.03.14 21:50, Kai Hendry (hendry at webconverger.com) wrote:

> 
> Thanks Michael for answering, :)
> 
> On 26 March 2014 18:59, Michael Biebl <mbiebl at gmail.com> wrote:
> > 2014-03-26 3:56 GMT+01:00 Kai Hendry <hendry at webconverger.com>:
> > If your daemon is not functional if the hardware is not present, I'd
> > probably start it via a udev rule and SYSTEMD_WANTS.
> 
> Do you have an example for this please?
> 
> I don't quite understand why I can't I just name the device in the
> service file. Why does it have to be so confusing. Still don't
> understand the need for escaping... is there a need?

Well, on the command line we will actually escape automatically for you,
i.e. "systemctl status /dev/sda5" will magically turn into "systemctl
status dev-sda5.device". However, we make stricter requirements when
writing unit files to avoid redundant syntaxes, and we should expect the
admin to take a little more care...

I think this is the right behaviour as it is OK to be a bit more sloppy
(and hence user-friendly) for day-to-day command lines, and require more
correctness when writing new files.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list