[systemd-devel] [PATCH] Add the most common consoles that MeeGo needs

Chris Ferron chris.e.ferron at linux.intel.com
Fri Jul 1 14:08:10 PDT 2011


On 07/01/2011 01:54 PM, Lennart Poettering wrote:
> On Fri, 01.07.11 09:19, Chris Ferron (chris.e.ferron at linux.intel.com) wrote:
>
> Heya,
>
>> MeeGo will use several consoles depending on the hardware adaptations.
>> This patch adds the most common to the serial-getty unit Install
>> section so when systemd is built for MeeGo as its distribution, you
>> get the most common Aliased for installation by the user.
> Hmm, this patch is borked, due to line breaks done by your mailer.
yes sorry about that.
>>   After=dev-%i.device systemd-user-sessions.service
>> plymouth-quit-wait.service
>> +m4_ifdef(`TARGET_MEEGO',
>> +After=dev-%i.device systemd-user-sessions.service
>> +)m4_dnl
> Why repeat the previous line? Note that multiple After= lines are
> merged, so this appears fully redundant to me?
good point
>>   m4_ifdef(`TARGET_FEDORA',
>>   After=rc-local.service
>>   )m4_dnl
>> @@ -44,3 +47,9 @@ KillMode=process
>>   # Some login implementations ignore SIGTERM, so we send SIGHUP
>>   # instead, to ensure that login terminates cleanly.
>>   KillSignal=SIGHUP
>> +
>> +m4_ifdef(`TARGET_MEEGO',
>> +[Install]
>> +Alias=sysinit.target.wants/serial-getty at ttyS0.service
>> sysinit.target.wants/serial-getty at ttyS1.service
>> sysinit.target.wants/serial-getty at tty01.service
>> sysinit.target.wants/serial-getty at ttyO2.service
>> +)m4_dnl
>> +
> Hmm, what's the rationale behind this? if those devices never show up
> then you end up spawning services with dependencies that necessarily
Oh so you will attempt to spawn service defined by Alias even if they 
have not been enabled?
I thought you would set up the Alias and then only if you enabled that 
name would it attempt start the service.

> time out (i.e. the non-existing serial ports). To make this nicer I'd
> turn this around: write a simple udev rule that matches against all ttys
> you are interested in and pull in a getty for each with
> SYSTEMD_WANTS. Something like this should do the job:
>
> SUBSYSTEM=="tty", KERNEL=="ttyS*|ttyO*|tty0*", TAG="systemd", ENV{SYSTEMD_WANTS}="serial-getty@%k.service"
interesting Idea.
> If you do this, then you'll spawn exactly the gettys that match your
> system, and this stuff is even hotpluggable. (i.e. if you extend this
> for ttyUSB you could get a getty on it as you plug it in, how awesome is
> that!).
>
> Also, this really looks like something that is more appropriately done
> with "ln -s" lines in the RPM .spec %post script?
yes I have something like this in our package as well.
> And the other gettys are pulled in by getty.target, which appears more
> appropriate than sysinit.target.
>
Thanks for the input. I will consider this PATCH punted, and will 
re-think the need. :
> Lennart
>



More information about the systemd-devel mailing list