ExecStart=/usr/lib/golang/bin run .
I have disable the selinux via setenforce 0. Then when I run the status I get this error message.
Redirecting to /bin/systemctl status -l commTest.service
● commTest.service - Comm Test
Loaded: loaded (/etc/systemd/system/commTest.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2023-01-03 20:48:06 +08; 7s ago
Process: 48515 ExecStart=/usr/lib/golang/bin run . (code=exited, status=203/EXEC)
Main PID: 48515 (code=exited, status=203/EXEC)
Jan 03 20:48:06 localhost.localdomain systemd: commTest.service: main process exited, code=exited, status=203/EXEC
Jan 03 20:48:06 localhost.localdomain systemd: Unit commTest.service entered failed state.
Jan 03 20:48:06 localhost.localdomain systemd: commTest.service failed.
What I would like to find out is that besides this method is there any other method to run golang as daemon or this is the best method ?
I have managed to run it ready by changing this line ExecStart=/usr/lib/golang/bin run . to /usr/bin/commTest/commTest. But anyway is this the right method to daemonise or any other better method for golang ?
Thank you yes I put my solution above after I found my mistake too. Few more questions I would like to confirm with you how about the User=root must it be root ? Also best how to maintain the logs. Lastly for golang will you recommend this method or any other method ?