-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Mosquitto Service #176
Comments
I'm not sure what the change to systemd has done for packages that don't directly support it, I'll take a look. |
SystemD do not support etc/inittab for respawn. I solved by deactivate your service and creating a new systemD .service If you want i can post it. Is it possibile test during mosquitto installation if is present systemD or other init system ? So if you found systemD you install the .service for systemD |
I presume you're referring to the Ubuntu packages here by the way, rather than self compiled. Ubuntu used upstart prior to systemd and the upstart script specified that mosquitto should be restarted. The system-v init script does not do this. I suspect what is happening is that systemd is using the system-v script to control mosquitto, but without support for restarting. There is already a service file in service/systemd, the package just needs updating. Bookmark for this is https://wiki.debian.org/Teams/pkg-systemd/Packaging |
We have had similar experiences of mosquitto shutting down and not being restarted in our setup of Ubuntu 16.04 servers (mostly due to segfault and gp fault in libwebsockets). I do see systemd service descriptions and code changes to the daemon in the service/systemd dir of the develop branch in what seems to involve signalling to systemd right before the main loop is entered. Eclipse bug #471053 suggest this is old unreleased work, but I also see it mentioned in the 1.5 changelog entry (which has a date on mosquitto.org but not on develop branch, is a tag/merge/push missing?). Our systems are using supervisord (Ubuntu 16.04/xenial package) for control of other services so I'm experimenting with a supervisord configuration for mosquitto. The simple case, not thoroughly tested, like the below in /etc/supervisor/conf.d/mosquitto.conf seems to do the expected when mosquitto is killed (remove /etc/init{.d,}/mosquitto{,.conf} to avoid conflict):
|
I saw the same after compiling 1.5 and I've now learned that systemd doesn't restart a service on sigterm. Pulling it hard with sigkill however does. The broker notification to systemd is only significant for other systemd units that is depending on mosquitto and notifies that mosquitto is completely up and running. |
For anyone interested, after my outage from #965, I did the following in
|
I'm quite certain that this has been fixed for a while for Debian and Ubuntu systems, so I'm closing this. |
The mosquitto service autostart at boot, but do not autostart on crash.
You can test it by
sudo pkill mosquitto
The service do not auto restart itself.
P.S. I'm on Ubuntu16, so SystemD
The text was updated successfully, but these errors were encountered: