[systemd-devel] How to get systemd to leave a USB serial console session alone when hadware is pulled?

Andrey Borzenkov arvidjaar at gmail.com
Tue May 21 23:54:39 PDT 2013


On Wed, May 22, 2013 at 8:12 AM, Kaz Kylheku <kaz at kylheku.com> wrote:
>
> On Wed, 22 May 2013 06:55:56 +0400, Andrey Borzenkov
> <arvidjaar at gmail.com> wrote:
>> В Tue, 21 May 2013 15:17:23 -0700 Kaz Kylheku <kaz at kylheku.com> пишет:
>>> The workaround is, at that point, to unplug the device
>>> and plug it back in. This will trigger a udev event (with
>>> the "reinserted"  attribute equal to "0": since no TTY session is
>>> being recovered: nothing has the TTY open). The custom udev
>>> rule fires, and systemd serves up an agetty.
>>>
>>
>> Do you use getty at .service template that is distributed with systemd? If
>> not, could you show full service definition?
>
> Yes, I just modified getty at .service. All I did to it is:
>
> --- a/units/getty at .service.m4
> +++ b/units/getty at .service.m4
> @@ -37,10 +37,10 @@ Restart=always
>  RestartSec=0
>  UtmpIdentifier=%I
>  TTYPath=/dev/%I
> -TTYReset=yes
> -TTYVHangup=yes
> -TTYVTDisallocate=yes
> -KillMode=process
> +TTYReset=no
> +TTYVHangup=no
> +TTYVTDisallocate=no
> +KillMode=none
>
>  # Unset locale for the console getty since the console has problems
>  # displaying some internationalized messages.
>

Try removing BindTo. In your case you do not really want to make
service dependent on existence of device, only first time launching of
it.


More information about the systemd-devel mailing list