[systemd-devel] next available VT for a service

Lennart Poettering lennart at poettering.net
Fri Jun 20 05:46:01 PDT 2014


On Mon, 16.06.14 17:20, Valentin Popa (valentin.popa at intel.com) wrote:

> Hi all,
> I want to start a service on the next available tty (let's call it
> %next_available_tty). In my case, this service handles
> weston-launch, but it could be any that requires a virtual terminal
> to run.
> Let's say some of the TTYs are already taken (by getty at tty1.service,
> etc) and I don't know which ; I would like to spawn a new user
> session that contains my new service on a spare tty. The service
> unit should look like this:
> 
> [Service]
> ExecStart=/usr/bin/weston-launch -some_parameter
> StandardInput=tty
> StandardOutput=journal
> StandardError=journal
> TTYPath=/dev/%next_available_tty # this is hardcoded for the moment
> 
> Weston must run from a virtual terminal.
> To launch the session, I use:
> https://github.com/sofar/user-session-units which checks for
> available seats, then creates a PAM session on tty1.
> 
> Without   %next_available_tty  I cannot get rid of these
> hard-codings and I need to know which tty will be available before
> the system boots ("reserve" it).
> 
> Does anyone know if such "feature" can be accepted in systemd. If
> not, maybe it can be done in another way. If yes, any pointers to
> start from?

Hmm, wouldn't it make more sense to buil this into weston-launch? I
mean, X11 has this logic, why wouldn't this be appropriate for Weston?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list