On Wed, 22 May 2013 06:55:56 +0400, Andrey Borzenkov <[email protected]> wrote: > В Tue, 21 May 2013 15:17:23 -0700 Kaz Kylheku <[email protected]> пишет: >> 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 [email protected] template that is distributed with systemd? If > not, could you show full service definition?
Yes, I just modified [email protected]. All I did to it is: --- a/units/[email protected] +++ b/units/[email protected] @@ -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. Basically systemd has to note that the device has been re-inserted (track its state), but not take any action; just know that the device is in and re-launch agetty when that session dies. Now if I add a line to the udev rules like: SUBSYSTEM=="tty", KERNEL=="ttyUSB[0-9]", ATTRS{is_console}=="1", ATTRS{reinserted}=="1", TAG+="systemd" Without: ENV{SYSTEMD_WANTS}+="getty@%k.service" (Note the ATTRS{reinserted)=="1" so that this fires in the appropriate case, when a removal and reinsertion takes place during an open TTY session). What happens is that systemd launches a new agetty upon reinsertion, which runs parallel with the shell session; they compete for input. There is some default action for that device so that if you don't specify a SYSTEMD_WANTS, it "wants" something anyway. Maybe it is possible to set SYSTEMD_WANTS to some kind of noop, so systemd wants nothing. I will search/experiment in that vein. Thanks again. _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
