My user is 'peaagent'. I have tried visudo -f /etc/sudoers.d/peaagent
with the following:
peaagent ALL = (root) NOPASSWD: /bin/systemctl stop postgresql.service
When I try stop Postgresql as peaagent it prompts me for a password:
peaagent@myserver:~$ /bin/systemctl stop postgresql.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'postgresql.service'.
Authenticating as: root
Password:
Anyone know why this doesn't work? Tx.