[Unit]
Description=Autostart Qt 5 Demo
Wants=systemd-udev-settle.service
After=systemd-udev-settle.service
[Service]
Type=simple
User=root
ExecStart=/usr/bin/qtLauncher /opt/bmrecorder/bin/bmrecorder
# Detach the framebuffer console from fb0 before starting the QtDemo and
# reattach it after QtDemo has stopped.
# See <linux>/Documentation/fb/fbcon.txt for details.
# NOTE: The dash "-" allows the commands to fail, e.g. if no virtual console
# was started.
# FIXME Is there a better command without shell invocation?
ExecStartPre=-/bin/sh -c "echo 0 > /sys/devices/virtual/vtconsole/vtcon1/bind"
ExecStopPost=-/bin/sh -c "echo 1 > /sys/devices/virtual/vtconsole/vtcon1/bind; echo -n -e '\033[9;0]' > /dev/tty0"
[Install]
WantedBy=multi-user.target
chmod 777 /opt/bmrecorder/bin/bmrecorder
systemctl daemon-reload
systemctl enable bm-recorder.service
systemctl status bm-recorder.service