Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#63046 - [hiawatha] service fails to start at boot with status 1/HUP

Attached to Project: Community Packages
Opened by Armand (Kewl) - Sunday, 30 June 2019, 19:33 GMT
Last edited by Kyle Keen (keenerd) - Tuesday, 09 July 2019, 01:36 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Kyle Keen (keenerd)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The hiawatha service happens to randomly terminates with status 1/signal hang up at startup
~~~
Jun 30 07:25:15 systemd[1]: hiawatha.service: Control process exited, code=killed, status=1/HUP
Jun 30 07:25:15 systemd[1]: hiawatha.service: Failed with result 'signal'.
Jun 30 07:25:15 systemd[1]: Failed to start Hiawatha Web Server.
~~~

Additional info:
* package version(s)10.9-2

Steps to reproduce:
After a fresh reboot check: `systemctl status hiawatha`
From time to time, the hiawatha service fails at startup with SIGHUP (see log above)
This task depends upon

Closed by  Kyle Keen (keenerd)
Tuesday, 09 July 2019, 01:36 GMT
Reason for closing:  Fixed
Additional comments about closing:  hiawatha 10.9-3
Comment by Armand (Kewl) - Monday, 01 July 2019, 06:48 GMT
What initially appeared to be random, happens whenever logrotate.service and hiawatha.service are starting at the same time and logrotate rotates `/var/log/hiawatha/access.log`. This can easily happen at boot time.
Looking at `/etc/logrotate.d/hiawatha`, logrotate executes `killall -HUP hiawatha` after rotation of the log file `/var/log/hiawatha/access.log`

While killall -HUP hiawatha should only trigger the unlocking of the log files (see https://gitlab.com/hsleisink/hiawatha/blob/master/src/hiawatha.c#L311), for some reason in this situation it fails and exit.

This is where I stand in my partial understanding of the issue.

Comment by Armand (Kewl) - Saturday, 06 July 2019, 13:58 GMT
After further investigation what seems to happen is that the killall -HUP hiawatha makes the ExecStartPre 'hiawatha -k' exit early and the service to fail.
Removing 'hiawatha -k' from the service's ExecStartPre (which is not necessary) fixes the bug.
The amended .service file is attached.
Comment by Kyle Keen (keenerd) - Tuesday, 09 July 2019, 01:33 GMT
While it isn't necessary, it is a best practice to perform validation checks. So I've got some concerns about removing this, but I don't see any other way around it either. In my humble opinion: HUP is supported by hiawatha and so should never cause hiawatha to crash. This could also be considered an upstream bug?

Loading...