[Unit]
Description=Debug Shell

DefaultDependencies=no
ConditionKernelCommandLine=|tty
ConditionKernelCommandLine=|debugging
ConditionPathExists=|/storage/.cache/debug.libreelec

[Service]
Environment=TTY=3
WorkingDirectory=/storage
ExecStart=/bin/sh -c '. /etc/profile; exec /bin/sh'
Restart=always
RestartSec=0
StandardInput=tty
TTYPath=/dev/tty3
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
# bash ignores SIGTERM
KillSignal=SIGHUP

[Install]
WantedBy=sysinit.target
