I've used golang to create a small program that runs silently in the background, and can run this program by typing ./my_app
It is located in $HOME/my_app/my_app
I went ahead and wrote a systemd my_app.service file:
[Unit]
Description="My Test Service"
[Service]
Type=simple
ExecStart= ~/my_app/my_app
[Install]
WantedBy=multi-user.target
However, when i run sudo systemctl start my_app.service, it errors out and returns
Failed to start my_app.service: Unit my_app.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status my_app.service' for details.
systemctl status my_app.service
returns
Apr 07 10:15:47 DEV-Rohan systemd[1]: Starting My Test App...
Apr 07 10:15:47 DEV-Rohan systemd[1]: Started My Test App.
Apr 07 10:36:34 DEV-Rohan systemd[1]: [/etc/systemd/system/my_app.service:6] Executable path is not abs
Apr 07 10:36:34 DEV-Rohan systemd[1]: my_app.service: Service lacks both ExecStart= and ExecStop= setti
Apr 07 11:00:39 DEV-Rohan systemd[1]: [/etc/systemd/system/my_app.service:6] Executable path is not abs
Apr 07 11:00:39 DEV-Rohan systemd[1]: my_app.service: Service lacks both ExecStart= and ExecStop= setti