Bug 1046493 - failed state at stop service
Summary: failed state at stop service
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: haveged
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jiri Hladky
QA Contact: Jiri Hladky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-25 20:09 UTC by Harald Reindl
Modified: 2014-03-07 06:33 UTC (History)
2 users (show)

Fixed In Version: haveged-1.8-0.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-09 21:44:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Harald Reindl 2013-12-25 20:09:26 UTC
this affects all fedora releases and results in case of having customized watchdogs in alert messages

Dec 25 21:05:36 srv-rhsoft haveged[18251]: haveged Stopping due to signal 15
Dec 25 21:05:36 srv-rhsoft systemd[1]: haveged.service: main process exited, code=exited, status=1/FAILURE

additionally you should consider Type=simple instead "Type=forking"
as it should be done for all services supporting foreground
mode, besides less costs at startup this way you do not need 
any PIDFile and avoid warnings in /var/log/messages that they
are not existing - i which maintainers would take a deeper
look in systemlogs at all 
___________________________________________

Type=simple
ExecStart=/usr/sbin/haveged -w 1024 -v 1 --Foreground

Comment 1 Jiri Hladky 2013-12-30 12:01:25 UTC
Hi,

I can change the service type to Simple. However, the main problem appears to be that SIGTERM will cause the program to end with exit code 1:

   signal(SIGTERM, tidy_exit);

static void tidy_exit(           /* OUT: nothing      */
   int signum)                   /* IN: signal number */
{
   error_exit("Stopping due to signal %d\n", signum);
}

static void error_exit(..) {
....
   exit(1);
}

I will talk to the upstream to change this.

Jirka

Comment 2 Jiri Hladky 2013-12-31 00:46:58 UTC
Hi,

I talked to the upstream. There will be new release soon with fixed exit codes - in case of signal it will be

128+signal

for SIGTERM the exit code is 143.

systemd has to be notified that exit code 143 indicates success via
SuccessExitStatus=143

I will update the service file and pack with the new version of haveged. 

Service file now looks like this:

more /dev/shm/haveged.service 
[Unit]
Description=Entropy Daemon based on the HAVEGE algorithm
Documentation=man:haveged(8) http://www.issihosts.com/haveged/

[Service]
Type=simple
ExecStart=/usr/sbin/haveged -w 1024 -v 1 --Foreground
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

Comment 3 Harald Reindl 2013-12-31 00:52:50 UTC
thank you very much for the quick and positive feedback, not only in case of the bug itself, also in case of the systemd-improvement!

Comment 4 Fedora Update System 2014-01-03 03:58:30 UTC
haveged-1.8-0.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/haveged-1.8-0.fc20

Comment 5 Fedora Update System 2014-01-03 10:33:45 UTC
haveged-1.8-0.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/haveged-1.8-0.fc19

Comment 6 Fedora Update System 2014-01-03 14:59:22 UTC
Package haveged-1.8-0.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing haveged-1.8-0.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-0121/haveged-1.8-0.fc20
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-01-21 05:51:20 UTC
haveged-1.8-0.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2014-03-07 06:33:07 UTC
haveged-1.8-0.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.