Skip to content
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

Ubtuntu 18.04 Package - Timeout Starting Service (but it starts..) #1427

Closed
peterchs opened this issue Sep 25, 2019 · 4 comments
Closed

Ubtuntu 18.04 Package - Timeout Starting Service (but it starts..) #1427

peterchs opened this issue Sep 25, 2019 · 4 comments

Comments

@peterchs
Copy link
Contributor

peterchs commented Sep 25, 2019

Following on from fix for #1425 I attempted to update packages. 1.6.7 was picked up, however this failed on upgrade.

I then purged/removed mosquitto and mosquitto clients packages which also uninstalled the lib package (to try and rule out config or environment problem);

apt-get purge --auto-remove mosquitto
apt-get purge --auto-remove mosquitto-clients

and attempted to reinstall. I am getting the following;

# apt-get install mosquitto mosquitto-clients
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libev4 libmosquitto1 libwebsockets8
The following NEW packages will be installed:
  libev4 libmosquitto1 libwebsockets8 mosquitto mosquitto-clients
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 444 kB of archives.
After this operation, 1,029 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http:https://ppa.launchpad.net/mosquitto-dev/mosquitto-ppa/ubuntu bionic/main amd64 libmosquitto1 amd64 1.6.7-0mosquitto1~bionic1 [78.6 kB]
Get:2 http:https://ppa.launchpad.net/mosquitto-dev/mosquitto-ppa/ubuntu bionic/main amd64 mosquitto amd64 1.6.7-0mosquitto1~bionic1 [188 kB]
Get:3 http:https://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libev4 amd64 1:4.22-1 [26.3 kB]
Get:4 http:https://ppa.launchpad.net/mosquitto-dev/mosquitto-ppa/ubuntu bionic/main amd64 mosquitto-clients amd64 1.6.7-0mosquitto1~bionic1 [79.3 kB]
Get:5 http:https://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libwebsockets8 amd64 2.0.3-3build1 [71.8 kB]
Fetched 444 kB in 1s (596 kB/s)
Selecting previously unselected package libmosquitto1:amd64.
(Reading database ... 148517 files and directories currently installed.)
Preparing to unpack .../libmosquitto1_1.6.7-0mosquitto1~bionic1_amd64.deb ...
Unpacking libmosquitto1:amd64 (1.6.7-0mosquitto1~bionic1) ...
Selecting previously unselected package libev4.
Preparing to unpack .../libev4_1%3a4.22-1_amd64.deb ...
Unpacking libev4 (1:4.22-1) ...
Selecting previously unselected package libwebsockets8:amd64.
Preparing to unpack .../libwebsockets8_2.0.3-3build1_amd64.deb ...
Unpacking libwebsockets8:amd64 (2.0.3-3build1) ...
Selecting previously unselected package mosquitto.
Preparing to unpack .../mosquitto_1.6.7-0mosquitto1~bionic1_amd64.deb ...
Unpacking mosquitto (1.6.7-0mosquitto1~bionic1) ...
Selecting previously unselected package mosquitto-clients.
Preparing to unpack .../mosquitto-clients_1.6.7-0mosquitto1~bionic1_amd64.deb ...
Unpacking mosquitto-clients (1.6.7-0mosquitto1~bionic1) ...
Setting up libev4 (1:4.22-1) ...
Setting up libwebsockets8:amd64 (2.0.3-3build1) ...
Setting up mosquitto (1.6.7-0mosquitto1~bionic1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/mosquitto.service → /lib/systemd/system/mosquitto.service.
Job for mosquitto.service failed because a timeout was exceeded.
See "systemctl status mosquitto.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mosquitto, action "start" failed.
● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
   Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: timeout) since Wed 2019-09-25 15:13:47 BST; 17ms ago
     Docs: man:mosquitto.conf(5)
           man:mosquitto(8)
  Process: 1329 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=0/SUCCESS)
 Main PID: 1329 (code=exited, status=0/SUCCESS)
dpkg: error processing package mosquitto (--configure):
 installed mosquitto package post-installation script subprocess returned error exit status 1
Setting up libmosquitto1:amd64 (1.6.7-0mosquitto1~bionic1) ...
Setting up mosquitto-clients (1.6.7-0mosquitto1~bionic1) ...
Processing triggers for systemd (237-3ubuntu10.29) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Errors were encountered while processing:
 mosquitto
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is with the fresh conf from the package, they were removed by the package purge/remove.

@peterchs
Copy link
Contributor Author

The service starts a process ok, its just not playing nicely with systemd in type notify mode.

I changed /lib/systemd/system/mosquitto.service to have Type=simple instead of notify, and the service is starting without error now. Also it automatically restarts when I kill -9 mosquitto PID.

@peterchs peterchs changed the title Ubtuntu 18.04 Package - Timeout Ubtuntu 18.04 Package - Timeout Starting Service (but it starts..) Sep 25, 2019
@ralight
Copy link
Contributor

ralight commented Sep 25, 2019

Sorry about that, a missing build dependency meant it wasn't building with systemd support, but wasn't failing at build time either. If you update now it should be fixed.

@grheard
Copy link

grheard commented Sep 25, 2019

Confirmed new build 1.6.7-0mosquitto2~xenial1 (for Ubuntu 16.04) corrects the notify issue. Thanks.

@peterchs
Copy link
Contributor Author

Likewise updated 1.6.7 installed and service started without issue. Confirmed notify systemd working. Kill -9 mosquitto pid and it restarted. Perfect. Thanks ralight. Closing issue.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants