Modify

Ticket #561 (closed task: fixed)

Opened 6 years ago

Last modified 6 years ago

improvement on runit scripts

Reported by: juruen@… Owned by: ejhernandez@…
Milestone: 0.10 Component: base
Severity: normal Keywords:
Cc:

Description (last modified by ejhernandez@…) (diff)

We use runit to start/stop eBox services like: squid, samba, ntp... We are doing a very primitive use of runit at the moment. Basically, we just let runit start the services everytime they go down by unknown reasons.

This behaviour can be dramatically improved and we should at least do the following:

  • Log whenever a service has been restarted
  • Do not try to restart a service infinitely, that is, if there's an error and a service cannot be started, runit will be trying to start the service all the time. A better approach would be to set a period of time, and a limit of restarting attempts during that period, in case of reach that limit it should stop trying and log the issue properly.
  • The log will be watched by EBox::Event::Watcher::Runit to inform administrator what it happens

Attachments

Change History

comment:1 Changed 6 years ago by ejhernandez@…

  • Owner changed from juruen@… to ejhernandez@…
  • Status changed from new to assigned
  • Description modified (diff)

I will do it right now!

Event watcher to that problem is added

comment:2 Changed 6 years ago by ejhernandez@…

  • estimatedhours changed from 0 to 20

comment:3 Changed 6 years ago by ejhernandez@…

(In [7785]) First runit wrapper script version refs #561

comment:4 Changed 6 years ago by ejhernandez@…

(In [7796]) * Added script to be called in finish scripts inside the runit arch to log how many times a service has been restarted in a time interval. If maximum restart number is exceeded, the eBox module which owns the service will be stopped

  • Added a configuration script to set the maximum number of restarts and the time interval
  • apache-perl in apache eBox module is already controlled by this new framework

refs #561

comment:5 Changed 6 years ago by ejhernandez@…

(In [7797]) Transform those files within tools/runit/ subdir which end at .finish to be the finish scripts in the corresponding runit directory refs #561

comment:6 Changed 6 years ago by ejhernandez@…

(In [7798]) Return false when the service managed by runit is executing finish script refs #561

comment:7 Changed 6 years ago by ejhernandez@…

(In [7799]) * Added Runit event watcher to check if some service is out of control to notice the eBox admin in some way

  • Change return value from run to get back an array ref of EBox::Event instead a single EBox::Event since Runit watcher may return more than one event at the same execution

refs #561

comment:8 Changed 6 years ago by ejhernandez@…

  • hours changed from 0 to 11.5
  • Status changed from assigned to closed
  • Resolution set to fixed
  • totalhours changed from 0.0 to 11.5

(In [7800]) * Updated pipe which communicates watchers and dispatchers to flush every new entry

  • Adapting to the new return value from EBox::Event::Watcher::run method [7799]

closes #561 (spent 11.5)

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.