[systemd-devel] Howto get the original TTY in a service

Mantas Mikulėnas grawity at gmail.com
Tue Jan 26 05:35:01 PST 2016


On Tue, Jan 26, 2016 at 3:31 PM, Martin Vogt <mvogt1 at gmail.com> wrote:

>
> Hello list,
>
> in a desktop session it is common behaviour to have a pop up dialog
> if the user presses CTRL+ALT+DEL.
> If the user press cancel, the original desktop is resumed.
>
> I like to have the same functionality on a virtual console.
> If the user hits CTRL+ALT+DEL on /dev/tty2 I can display a dialog:
>
> [ ] reboot
> [ ] halt
> [ok] [cancel]
>
> and if the user hits cancel the focus should switch back to the virtual
> console, where
> CTRL+ALT+DEL was pressed.
>
> I need the console in a shutdownselect.service file (and in the script)
> where the user pressed CTRL+ALT+DEL.
>
> I cannot figure out how to do it.
>
> The script started from systemd gets for the tty command "not a tty"
>

StandardOutput=tty? /sys/class/tty/tty0/active?

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20160126/ec3eab05/attachment.html>


More information about the systemd-devel mailing list