I have two systemd services, one is a flask app meant to proxy calls to a C backend. While the flask app works the C program does not start at boot.
My service file looks like this:
[Unit]
Description=my backend
After=multi-user.target
[Service]
User=root
ExecStart=/home/root/camtool
Type=dbus
BusName=com.camera
Restart=always
RestartSec=10and i have enabled the service like this:systemctl enable camtool.service
The service starts if i do a systemctl start camtool.service but if i reboot the device, the service is not started.
output of systemctl status camtool:
● camtool.service - my backend Loaded: loaded (/etc/systemd/system/camtool.service; enabled; vendor preset: disabled) Active: inactive (dead)If i check journalctl, there are no entries.
journalctl -u camtool
-- Logs begin at Wed 2021-07-14 14:12:26 UTC, end at Wed 2021-07-14 14:16:26 UTC. --
-- No entries --I am unsure how to debug this further, as there does not seem to be any error messages. How can i proceed to figure out why the program didn't start? is there a way i can verify if it was even attempted?
The C program use DBUS to expose functions for the flask app, and stream data via sockets.
21 Answer
It seems i fixed the problem by re enabling the service. I had made many changes to try and fix the file, but when i disabled and re enabled i realised the symlink was in the wrong place.
By disabling and enabling this was fixed. I would recommend to disable and re enable when ever changes are made to the areas concerning targets.
Before i did that i added the wantedby=multi-user.target.
The commands looked like this:
root@system:~# systemctl disable camtool
Removed /etc/systemd/system/
root@system:~# systemctl enable camtool
Created symlink /etc/systemd/system/ → /etc/systemd/system/camtool.service.Now it boots with the system.