Local Deployment with systemd on Fedora/Opensuse

User / Community contributed content: modifications, patches, extensions, modules, scripts etc.
Local Deployment with systemd on Fedora/Opensuse

Post by justlikeef » Fri Dec 23, 2011 09:56

I don't know if this is specific to just these two distributions, or something with systemd, but I was unable to get the restart function of the local deployment working with the instructions on the site. I kept getting errors about the tty not being available, then kept getting asked for the password even with the NOPASSWD parameter on the line in sudoers. I tried aliasing the command and users, adding the !requiretty parameter, etc. but nothing worked.

To get it to work I created a script in include/modules/deployment/local call restartnagios and set the mode to 755. The script contains the line:

Code: Select all

systemctl nagios restart.service
Then in sudoers, my line looks like:

Code: Select all

wwwrun  ALL = (root) NOPASSWD: /srv/www/htdocs/nconf/include/modules/deployment/local/restartnagios
where wwwrun is replaced by the apache user.

In the deploy.conf I have:

Code: Select all

reload_command = "sudo /srv/www/htdocs/nconf/include/modules/deployment/local/restartnagios"

User avatar
NConf developer
NConf developer
Joined:Mon Mar 16, 2009 14:23
Location:Bern, Switzerland

Re: Local Deployment with systemd on Fedora/Opensuse

Post by fgander » Fri Dec 23, 2011 23:43

Okey, thanks for your feedback and your contribution!

Regards Fabian
F.G. - NConf developer
Follow NConf on Twitter!