I'm trying to autostart an interactive C++ program at boot before TTY1 appears.
I have created a file called /etc/systemd/system/myapp.service
with the following contents:
[Unit]
Description=myapp
[Service]
Type=oneshot
ExecStart=/home/xxx/myapp.exe start
StandardOutput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
And then ran
sudo systemctl enable myapp
Unfortunately, it doesn't work as expected. I can't interact with myapp
, and I do not want TTY1 to appear until the program ends
UPDATE: My app now works before the TTY appears.
/etc/systemd/system/myapp.service
now contains:
[Unit]
Description=myapp
After=sysinit.target
[Service]
Type=oneshot
StandardOutput=tty
RemainAfterExit=yes
ExecStart=/home/xxx/myapp.exe start
[Install]
WantedBy=multi-user.target
But I still can't interact with my program.