Ubuntu 22.04 - Systemd Service scenarios to Start with 'No such file or directory' scenarios for Custom Go Binary
Quick question that's been bugging me - I'm working with an scenario where my custom Go application fails to start as a systemd service on Ubuntu 22.04. I have created a service file located at `/etc/systemd/system/myapp.service` with the following content: ```ini [Unit] Description=My Go Application After=network.target [Service] ExecStart=/usr/local/bin/myapp Restart=always User=myuser Group=mygroup Environment=ENV_VAR=value [Install] WantedBy=multi-user.target ``` When I try to start the service using `sudo systemctl start myapp`, I receive the following behavior in the logs: ``` Failed to start myapp.service: Unit myapp.service failed to load: No such file or directory. ``` I've checked that the path to the executable is correct, and I can run the application manually without any issues. The permissions for the binary are set to be executable: ```bash ls -l /usr/local/bin/myapp ``` Output: ``` -rwxr-xr-x 1 myuser mygroup 123456 Jan 1 00:00 /usr/local/bin/myapp ``` Additionally, I've ensured that I've reloaded the systemd daemon after creating the service file using `sudo systemctl daemon-reload`. However, the service still fails to start. I've also checked the `/var/log/syslog` for any additional behavior messages but found nothing that gives more context. Could there be something wrong with the service file formatting or any other potential issues causing systemd to not recognize the binary? Any help or suggestions would be greatly appreciated! Could this be a known issue?