#!/usr/bin/execlineb -P
# Do not use "exec -c" or "fdmove -c": that yields a restart loop
# and the host shows "Display output is not active". LightDM's own
# log (paths in lightdm.conf / /var/log/lightdm/) is enough; the s6
# pipeline still captures stdout without merging stderr via fdmove -c.
envfile /etc/s6-rc/config/lightdm.conf
importas -sCuD "" Args Args
# Shared user-data dir (USERS_DIR); missing on some live images.
foreground { mkdir -p /var/lib/lightdm/data }
foreground { chown lightdm:lightdm /var/lib/lightdm /var/lib/lightdm/data }
exec /usr/sbin/lightdm ${Args}
