amonapp / amonagent

Single binary agent for Linux
https://amon.cx
MIT License
48 stars 21 forks source link

Bug: Debian/Ubuntu - Agent failed to start #28

Open DerDanilo opened 6 years ago

DerDanilo commented 6 years ago

Every time I restart the amon instance the amonagent on it doesn't start properly anymore. I then have to remove and reinstall the amonagent package to get it working again.

Any idea why this happens? Installation is done with root, so I don't get the issue with the "permission denied".

Feb  1 19:43:02 mon amonagent[2718]: time="2018-02-01T19:43:02+01:00" level=info msg="Starting Amon Agent (Version: 0.7.5.3)\n"
Feb  1 19:43:02 mon amonagent[2718]: time="2018-02-01T19:43:02+01:00" level=fatal msg="Failed to verify pid directory  mkdir /var/run/amonagent: permission denied"
martinrusev commented 6 years ago

@DerDanilo I will take a look whenever I have the time. Switched to a new python based release pipeline and some small issues here and there still remain. https://github.com/amonapp/amonagent/blob/master/build.py

And this is the line that should take care of the error you see: https://github.com/amonapp/amonagent/blob/master/packaging/init.sh#L36

Can you tell me your Debian/Ubuntu distro version?

ghost commented 6 years ago

Ubuntu 16.04

I just changed the user in the systemd service file and now it seems to work fine. The package seems to install with root, starting the service with root and on reboot tries to start the service with the amonagent user. Is there a problem starting the service with root rights?

martinrusev commented 6 years ago

@dschwabeS11 Thanks for the report. Will check the build pipeline to see what the issue might be. Starting any service with root rights is a no go in an Enterprise scenario with strict permissions

DerDanilo commented 6 years ago

Starting any service with root rights is a no go in an Enterprise scenario with strict permissions

Of course. I meant in connection with amonagent as I only see this as a temporary workaround.

Grisu118 commented 6 years ago

This should be fixed with #26