netbox-agent
netbox-agent copied to clipboard
add sudo support
This allows the agent to run under a non-root account
Note that sudo
doesn't exist by default on all distributions.
I agree with @ramnes
What about a variable in the configuration file to enable sudo or not?
There are currently 3 different ways to execute an external program in the code.
I can combine them into one, along with a check function that can make sure everything is installed, and if it's not complain about/ignore it.
So, for sudo, if it's installed, and you run as root, no change would be needed; if sudo is not installed, it's no problem then. if your running the agent as non-root (which you really should do), then sudo will be needed, and if it's not installed, it can stop and complain.
This will prevent partial host registrations also.
@ThomasADavis I've rebased the branch on master Are you still up to make the modification mentionned in your last comment ?
Thanks!