dlangille/anvil

Change script to allow other services restarted as well

Closed this issue · 9 comments

Currently, with every update of anvil I need to modify the script to allow for other services, not explicitly mentioned in the script, to be restarted as well.

Services are (for instance) mattermostd, courier-imap-imapd-ssl, sabnzbd and others.

What? I have users?

Yeah, I wonder how best to do this. Sounds like a hook-type thing.

Here, run 'this script'.

How would you prefer to handle it? A configuration item:

USER_RESTART="mattermostd courier-imap-imapd-ssl sabnzbd"
USER_RELOAD="foo bar"

for service in $USER_RESTART
do
  service $service restart
done

for service in $USER_RELOAD
do
  service $service reload
done

This is a security risk, but it's all up to the user.

certpuller -s needs to be updated too.

This is a security risk, but it's all up to the user.

Not sure why this is a security risk: the script runs as anvil user, and as such it has no authorizations to restart whatever service, unless explicitly configured in sudoers

I ran this through on one server. Do you want to give it a go?

It sounds like it worked.