-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restart services if required #309
Comments
@tobiastom is this still an issue?? If so I can look at it but to my knowledge this works in all template deployments. If it is still an issue detail me exactly how to reproduce the issue. @cedwards any insight on this one??? |
@tobiastom inside a template there are multiple ways to accomplish this, the easiest one is use a CMD and restart the service. The template goes down the list running commands so adding a service restart at the end of the template should work. If you have any issues with this still reach out to me directly. |
I don't think there is a proper solution for this right now, and I would argue that this issue should be reopened. A |
See the output below. A restart starts the service when it is not running.
Just add EDIT: this might only be applicable to some services. Perhaps you can show an example of a service that doesn't work for you? @tobiastom |
@tobiastom is a restart in the template acceptable behavior?? |
You can also add RESTART to restart the entire jail, which will in turn load any new configurations. |
@tobiastom is the two suggestions above good to solve your issue? Trying to make sure we have addressed all the issues outstanding. |
Is your feature request related to a problem? Please describe.
Coming from Ansible, I'd like to have a way inside the
Bastillefile
to restart a service if something has changed.Right now I have to options:
SERVICE foo start
: it will make sure the service is restarted. If it was not started, it will start and the possible new configuration will take effect.SERVICE foo restart
: If the service is already started, it will restart the service and the changes will take effect. The problem is: if the service is not started yet, it will also not be started at all.I'd like to see a reliable way to apply Bastille Templates multiple times and if the configuration did change, it should be applied automatically.
Describe the solution you'd like
Ideally I'd like to restart (or start) a service only if something has changed. As this seems to be quite hard right now, especially with
CMD
andOVERLAY
/RENDER
combinations, I'd like to see a safe way to start a service if it is not running, but also restart it if it already was running.I have no idea about how this feature could be named, but I'd like to use something like this inside the
Bastillefile
:Describe alternatives you've considered
For now I used
SERVICE foo start
, which will never apply changes to the running service. I then restarted the jail, which could take some time and mean some service downtime, especially if other jails depend on it.Then I tried to use
SERVICE foo restart
everywhere. Unfortunately this makes things works as changes to running services are applied, but they are not started on the initial creation of the jails.The text was updated successfully, but these errors were encountered: