Bug 786275 - Change to systemd causes monit startup to report fail
Summary: Change to systemd causes monit startup to report fail
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: monit
Version: 16
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Maxim Burgerhout
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-31 22:06 UTC by Ken Hall
Modified: 2012-02-10 00:52 UTC (History)
4 users (show)

Fixed In Version: monit-5.2.5-3.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-10 00:52:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ken Hall 2012-01-31 22:06:33 UTC
Description of problem:
Update of systemd changed behavior so when SYSVINIT script for monit runs, systemd looks for /var/run/monit to determine whether daemon actually started.  As shipped, monit creates /var/run/monit.pid, so systemd never recognizes startup of daemon.  This results in long hang during boot and error messages during manual attempts to restart monit.  Changing init script to create the proper pidfile corrects the problem.  pidfile is passed on command line of monit daemon program.


Version-Release number of selected component (if applicable):
systemd-37-11
monit-5.2.5-2

How reproducible:
Every time

Steps to Reproduce:
1. Upgrade system to levels described
2. Configure monit to start on boot with default options
3. Restart system or start monit manually
  
Actual results:
System/command hangs, finally reports:

Jan 31 16:24:18 raptor systemd[1]: monit.service operation timed out. Terminating.
Jan 31 16:24:18 raptor systemd[1]: Unit monit.service entered failed state.
Jan 31 16:33:23 raptor monit[1717]: Starting monit:
Jan 31 16:33:23 raptor systemd[1]: PID file /var/run/monit not readable (yet?) after start.
Jan 31 16:38:23 raptor systemd[1]: monit.service operation timed out. Terminating.
Jan 31 16:38:23 raptor systemd[1]: Unit monit.service entered failed state.

At this point monit daemon is running properly, but systemd does not recognize it.

Expected results:
Daemon starts and systemctl/service command returns normally.

Additional info:

Comment 1 Chris Rouch 2012-02-01 10:11:30 UTC
I'm seeing something similar with portsentry, which doesn't create a pid file:

Jan 29 06:31:02 gwladys systemd[1]: Failed to read PID file /var/run/portsentry.pid after start. The service might be broken.

At this point portsentry is running normally.

portsentry has a sysv init script /etc/init.d/portsentry 

This is with systemd-37-11. Reverting to systemd-37-3 makes everything work as expected.

Comment 2 Fedora Update System 2012-02-01 10:18:08 UTC
monit-5.2.5-3.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/monit-5.2.5-3.fc16

Comment 3 Maxim Burgerhout 2012-02-01 10:27:42 UTC
I rebuilt the monit RPM for F16. The problem was that systemd now reads the SysV init script and looks for a pidfile keyword. If that is found, it reads the name of the PID file from there. We have had /var/run/monit in there for ages. I changed that line to /var/run/monit.pid and it runs fine now on my system.

I uploaded the update to Bodhi already (see above). Maybe you guys can test it and give it some karma so it flows through Bodhi a bit faster :)

Thanks for reporting this bug.

Comment 4 Chris Rouch 2012-02-01 11:02:20 UTC
The portsentry init.d file contained:

# pidfile: /var/run/portsentry.pid

Removing this fixes the problem for me.

Comment 5 Ken Hall 2012-02-01 14:52:41 UTC
Provided update to monit corrects problem.  Thanks!

Comment 6 Fedora Update System 2012-02-01 19:22:55 UTC
Package monit-5.2.5-3.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing monit-5.2.5-3.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-1110/monit-5.2.5-3.fc16
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2012-02-10 00:52:11 UTC
monit-5.2.5-3.fc16 has been pushed to the Fedora 16 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.