[systemd-devel] How service can block login on tty

Michal Sekletar msekleta at redhat.com
Wed Jul 29 01:27:38 PDT 2015


Hi,

Fedora and RHEL both ship initial-setup services. If initial-setup is 
enabled then it must start *before* login is allowed.

Consider system which has multiple serial consoles attached then to 
achieve above initial-setup-text.service must have 
Before=serial-getty at ttyS0.service serial-getty at ttyS1.service explicitly 
specified in service file. Having to enumerate all possible instance 
names for serial-getty at .service is not practically possible. Thus, the 
question is $subject, but in generic way.

I think that introducing new target, e.g. getty-pre.target might be 
solution to this really generic problem. Now both getty at .service and 
serial-getty at .service have Before=getty.target. We would add 
After=getty-pre.target to those service files. Then getty-pre.target 
will have no explicit dependencies defined and will be pulled in to the 
transaction by service which wants to block login on tty, e.g. thus 
initial-setup-text.service will add Wants=getty-pre.target 
Before=getty-pre.target.

Does scheme described in last paragraph makes sense?

Michal


More information about the systemd-devel mailing list