Bug 45608 - getty-generator: please support overloading getty@.service
Summary: getty-generator: please support overloading getty@.service
Status: REOPENED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Lennart Poettering
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-04 01:35 UTC by Michał Górny
Modified: 2014-09-10 19:51 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Michał Górny 2012-02-04 01:35:16 UTC
I have my own /etc/systemd/system/getty@.service. However, systemd-getty-generator relies on hardcoded original path to it. Thus, the default bundled unit is always used.

I'd appreciate if generators could be made to use the same service lookup as systemd does use when running services manually.
Comment 1 Lennart Poettering 2012-02-10 15:31:36 UTC
Hmm, actually systemd allows overriding in this case. The file symlinks point to are only used as fallback if no better file is available in /run, /etc, /usr/lib.

So, are you sure that things are broken for you? Shouldn't it suffice just copying your getty service template from /usr/lib to /etc and be done with it?
Comment 2 Michał Górny 2012-02-10 15:58:25 UTC
Note: /etc/systemd/system/getty@.service is a symlink to mingetty@.service.
Comment 3 Zbigniew Jedrzejewski-Szmek 2014-06-24 03:44:56 UTC
I copied getty@.service to /etc/systemd/system, edited it a bit, and rebooted. This new files is used.
Comment 4 Ed Swierk 2014-09-10 19:51:32 UTC
(In reply to comment #1)
> Hmm, actually systemd allows overriding in this case. The file symlinks
> point to are only used as fallback if no better file is available in /run,
> /etc, /usr/lib.
> 
> So, are you sure that things are broken for you? Shouldn't it suffice just
> copying your getty service template from /usr/lib to /etc and be done with
> it?

I suspect what the reporter wants is automatically-generated instances from an alternative getty service template /etc/systemd/system/serial-getty@.service.

Currently systemd-getty-generator instantiates the template for, say, ttyS0 by creating a symlink /run/systemd/generator/getty.target.wants/serial-getty@ttyS0.service that always points to /lib/systemd/system/serial-getty@.service, even if /etc/systemd/system/serial-getty@.service exists.

Of course if you create a symlink /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service pointing to /etc/systemd/system/serial-getty@.service, your symlink overrides the automatically-generated symlink in /run/systemd, but having to do that sort of defeats the purpose of the generator.

The desired behavior would involve replacing the hardcoded SYSTEM_DATA_UNIT_PATH in add_symlink() in http://cgit.freedesktop.org/systemd/systemd/tree/src/getty-generator/getty-generator.c?id=v216 with the path lookup logic used for normal units.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.