|Summary:||getty-generator: please support overloading getty@.service|
|Product:||systemd||Reporter:||Michał Górny <mgorny>|
|Component:||general||Assignee:||Lennart Poettering <lennart>|
|Status:||REOPENED ---||QA Contact:|
|i915 platform:||i915 features:|
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.