Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gonic.service systemd service fails on Debian #126

Closed
spencermathews opened this issue Mar 9, 2021 · 2 comments
Closed

gonic.service systemd service fails on Debian #126

spencermathews opened this issue Mar 9, 2021 · 2 comments

Comments

@spencermathews
Copy link

I installed gonic as per the systemd section of the README, but the gonic.service unit file as written fails with the following output (from journalctl -u gonic):

Mar 08 16:52:33 raspberrypi systemd[1]: Starting Gonic service...
Mar 08 16:52:33 raspberrypi sleepservice[3998]: /bin/chown: invalid user: ‘syslog:adm’
Mar 08 16:52:33 raspberrypi systemd[1]: gonic.service: Control process exited, code=exited, status=1/FAILURE
Mar 08 16:52:33 raspberrypi systemd[1]: gonic.service: Failed with result 'exit-code'.
Mar 08 16:52:33 raspberrypi systemd[1]: Failed to start Gonic service.
Mar 08 16:52:44 raspberrypi systemd[1]: gonic.service: Service RestartSec=10s expired, scheduling restart.
Mar 08 16:52:44 raspberrypi systemd[1]: gonic.service: Scheduled restart job, restart counter is at 6.
Mar 08 16:52:44 raspberrypi systemd[1]: Stopped Gonic service.

I'm running on Raspberry Pi OS (Buster). Debian (and consequently Raspberry Pi OS) uses rsyslog and lacks the syslog user referenced in the unit file:

# make sure log directory exists and owned by syslog
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/log/gonic
ExecStartPre=/bin/chown syslog:adm /var/log/gonic
ExecStartPre=/bin/chmod 755 /var/log/gonic
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sleepservice

I believe this entire offending block can be removed since systemd services log stdout and stderr to the systemd journal by default, and without making assumptions about the system's logging.

It appears that gonic doesn't actually write to /var/log/gonic, anyway. Does it?

Lastly, FWIW, PermissionsStartOnly is also deprecated. I get the sense that the referenced section of the unit file was more or less just copied from some template without regard for its actual function.

@sentriz
Copy link
Owner

sentriz commented Apr 20, 2021

cc @IUCCA 👌

@sentriz
Copy link
Owner

sentriz commented May 11, 2021

thanks, I updated the docs after testing out an ubuntu install myself. any thoughts on these changes?
4b3f890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants