FS#59162 - [unbound] Systemd can't stop unbound.service gracefully

Attached to Project: Community Packages
Opened by Géza Búza (medve540) - Wednesday, 27 June 2018, 19:03 GMT
Last edited by Gaetan Bisson (vesath) - Saturday, 28 July 2018, 00:13 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

At shutdown the following message appears on the screen:
"A stop job is running for unbound.service"
This blocks the shutdown process as it waits for 1 minutes 30 seconds for unbound to stop.

Workaround:
Open the file /usr/lib/systemd/system/unbound.service for editing and remove the line containing "PIDFile=/run/unbound.pid".
After that run "sudo systemctl daemon-reload".

Additional info:
* package version: 1.7.3-1
* Systemd version: 238.133-4
* config see attached file
* see similar issue: https://bugs.squid-cache.org/show_bug.cgi?id=3826

Steps to reproduce:
1. sudo pacman -S unbound
2. sudo systemctl start unbound
3. sudo systemctl stop unbound
This task depends upon

Closed by  Gaetan Bisson (vesath)
Saturday, 28 July 2018, 00:13 GMT
Reason for closing:  Fixed
Additional comments about closing:  unbound-1.7.3-3 in [community-staging]
Comment by Eli Schwartz (eschwartz) - Friday, 27 July 2018, 16:14 GMT
  • Field changed: Status (Unconfirmed → Assigned)
  • Field changed: Category (Packages: Extra → Packages)
  • Field changed: Architecture (x86_64 → All)
  • Task assigned to Gaetan Bisson (vesath)
Upstream provides an --enable-systemd option which is disabled by default, using it results in unbound being linked to libsystemd.so and enabling the use of Type=notify

Upstream also provides their own service and socket in contrib/, which utilizes Type=notify
Comment by Gaetan Bisson (vesath) - Friday, 27 July 2018, 23:33 GMT
Géza: I cannot reproduce your problem but we can safely remove the PIDFile line from the service file.

Eli: Thanks, I'll switch to upstream's service file. Linking against systemd is fine by me; as our official init it's expected to be already installed on every Arch system anyhow.
Comment by Gaetan Bisson (vesath) - Friday, 27 July 2018, 23:45 GMT
It turns out upstream's service file fails for me with result 'protocol' (whatever that means).
So instead of patching it we'll keep our simpler service file for now.
Comment by Gaetan Bisson (vesath) - Saturday, 28 July 2018, 00:07 GMT
Oh, well, Type=notify fails for me too: unbound never notifies anything to systemd and `systemctl start` is left hanging. We'll just get rid of PIDFile=... Sorry for the noise.

Loading...