## **************************************************************************
## For copyright and licensing terms, see the file named COPYING.
## **************************************************************************

[Unit]
Description=Virtual console multiplexor driving %I

[Service]
Umask=0002
User=user-vt-multiplexor
SessionLeader=yes
# The user-vt-multiplexor user is not a member of this group.
# Running the multiplexor as this group the group's members realizer access to its I/O files.
Group=user-vt-realizer
PermissionsStartOnly=yes
# This mechanism now permits subdirectories.
RuntimeDirectory=dev/%Imux
RuntimeDirectoryMode=02755
# Files in /run/dev/%I have group user-vt-multiplexor by default, not group user-vt-realizer.
RuntimeDirectoryGroup=user-vt-multiplexor
# Not until we find out how to have ACLs in /run on FreeBSD.
#ExecStartPre=install -d -m 02775 -o root -g user-vt-multiplexor %t/dev/%Imux
#ExecStartPre=setfacl -m u:user-vt-multiplexor:rwx %t/dev/%Imux
ExecStart=sh -c 'exec %p %t/dev/%Imux vc[0-9]*'

[Install]
WantedBy=multi-user.target
