Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 392289

Summary: app-admin/monit should be started as last service
Product: Gentoo Linux Reporter: Marc Schiffbauer <mschiff>
Component: Current packagesAssignee: Patrick Lauer <patrick>
Status: CONFIRMED ---    
Severity: normal CC: jstein, marek, polynomial-c, web
Priority: Low Keywords: PATCH, PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/29632
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: monit patch

Description Marc Schiffbauer gentoo-dev 2011-11-28 16:49:52 UTC
I am not really sure how this can be done with openrc but I think it would be a good idea to start the monit service after all other services have been startet on startup.

Otherwise it will interfere with the normal system startup or runlevel change.
At least it looked like that at the last startup of one of my servers where nearly everything is monitored via monit.

For example my sshd was too early I guess (it did not bind to all ips it should have done...):

Part of logs form last system startup:

Nov 28 14:48:12 pluto monit[4134]: 'sshd' process is not running
Nov 28 14:48:12 pluto monit[4134]: Cannot open a connection to the mailserver 'localhost:25' -- Transport endpoint is not connected
Nov 28 14:48:12 pluto monit[4134]: No mail servers are available
Nov 28 14:48:12 pluto monit[4134]: Aborting event
Nov 28 14:48:12 pluto monit[4134]: 'sshd' trying to restart
Nov 28 14:48:12 pluto monit[4134]: 'sshd' start: /etc/init.d/sshd
Nov 28 14:48:12 pluto /etc/init.d/sshd[4282]: WARNING: sshd is already starting



What do you think?
Comment 1 Patrick Lauer gentoo-dev 2011-11-29 01:52:07 UTC
That's a mostly reasonable suggestion.

What you could do as a temporary improvement is to delay monit - as far as I remember it has a startup timeout that can be set in the config, set that to maybe 5 minutes and it won't interfere with normal startup.
Comment 2 Marc Schiffbauer gentoo-dev 2015-03-10 01:47:49 UTC
The delay in monitrc seems to be good solution. Feel free to close this bug. And thanks for the suggestion.
Comment 3 INODE64 Sistemas 2016-11-21 12:41:18 UTC
Created attachment 453974 [details, diff]
monit patch

Start after all services
Comment 4 INODE64 Sistemas 2016-11-21 12:45:24 UTC
I changed init.d to start after all services and it stop fisrt by when shutdown of server, the monit start again the services when stopped