Feature #2014

Service supervision with Upstart

Added by Davide Principi about 8 years ago. Updated over 7 years ago.

Status:CLOSEDStart date:11/15/2013
Priority:NormalDue date:11/15/2013
Assignee:-% Done:

100%

Category:nethserver-lib
Target version:v6.5-beta3
Resolution: NEEDINFO:No

Description

A critical service (like slapd) needs a supervisor to start the service in case of accidental crash.

Currently runlevel-adjust action enables/disables init.d/ scripts and executes service start/stop commands.

This new feature should disable init.d/ scripts and provide an implementation for daemon starting, stopping and supervision, based on Upstart

The implementation must be extensible to support systemd, the substitute of Upstart, available in RHEL7.


Related issues

Related to NethServer 6 - Enhancement #2460: Give wings to server-manager CLOSED 12/12/2013 12/13/2013
Related to NethServer 6 - Bug #2680: Backup config: can't restore LDAP dump CLOSED

Associated revisions

Revision 547b73e8
Added by Davide Principi over 7 years ago

Upstart configuration for httpd-admin. Refs #2014

Revision c7376f62
Added by Davide Principi over 7 years ago

Use Upstart for ntopng daemon control. Refs #2014

The Upstart configuration coming with ntopng RPM does not handle fork
expectation correctly. This configuration avoid the startup fork() and
fixes the problem.

Revision 2d9918a7
Added by Davide Principi over 7 years ago

Added upstart-job template. Refs #2014

This is a generic upstart job configuration template that can be
instantiated from templates.metadata.

Revision 1c52af52
Added by Davide Principi over 7 years ago

Implemented Upstart service supervison. Refs #2014

If an upstart job configuration is present for a given service, SysV
init scripts are disabled and all service actions
(start/stop/restart/reload/status) are executed by initctl.

Revision d928addb
Added by Davide Principi over 7 years ago

slapd and nslcd configuration for Upstart. Refs #2014

Revision 5fc049e2
Added by Davide Principi over 7 years ago

Escape dash chars in DBus paths of Upstart jobs. Refs #2014

Fix service names containing "-" for dbus-send invocation,
substituting "-" with "_2d".

Revision 2dc30599
Added by Davide Principi over 7 years ago

Added read-service-status helper for Dashboard UI module. Refs #2014

This helper script prints out all services status in JSON format,
relying on NethServer::Service Perl module. Using the helper the
Dashboard UI module is unaware of the underlying implementation of the
service control (SysV, Upstart...).

Revision 931ac602
Added by Davide Principi over 7 years ago

Create /etc/ntopng directory for ntopng configuration. Refs #2014

Revision bbf81fe1
Added by Davide Principi over 7 years ago

Stop daemon and disable SysV script if defined also in Upstart. Refs #2014

Revision 4cb9f2ea
Added by Davide Principi over 7 years ago

Wait for nslcd to complete startup. Refs #2014

Revision 680d595d
Added by Davide Principi over 7 years ago

NethServer::Service (adjust): changed return value type to boolean. Refs #2029 #2014

The method now returns a TRUE/FALSE success condition, and sets again
the output parameter "action", passed by reference.

Revision 507aa85d
Added by Davide Principi over 7 years ago

Report errors in exit status code. Refs #2029 #2014

Revision b26684ff
Added by Davide Principi over 7 years ago

httpd-admin graceful restart on nethserver-samba-update. Refs #2014

Activate httpd-admin configuration for Win registry patches.

History

#1 Updated by Filippo Carletti almost 8 years ago

  • Target version changed from ~FUTURE to v6.5-beta3

#3 Updated by Davide Principi over 7 years ago

  • Due date set to 11/15/2013
  • Status changed from NEW to TRIAGED
  • Start date set to 11/15/2013
  • % Done changed from 0 to 20
  • Estimated time set to 8.00

#4 Updated by Davide Principi over 7 years ago

  • Assignee set to Davide Principi

#5 Updated by Davide Principi over 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#6 Updated by Davide Principi over 7 years ago

  • Subject changed from Base: service supervision with upstart to Service supervision with Upstart
  • Description updated (diff)
  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Modified

  • nethserver-lib
    The NethServer::Service Perl module was modified to manage both SysV scripts and Upstart jobs. An Upstart job take precedence over a SysV script with the same name. A generic Upstart job template, upstart-job was added: it can be instantiated from templates.metadata, providing actual values in MORE_DATA (see esmith::templates for more details).
  • nethserver-ntopng
    An Upstart job definition comes with the ntopng RPM, but was not working in our setup: it has been fixed. See Upgrade-script-64rc1 release notes.
  • nethserver-directory
    slapd and nslcd daemons are now Upstart jobs. nslcd starts after slapd and stops before slapd is stopped.
  • nethserver-httpd-admin
    The SysV httpd-admin script was removed: now it uses an Upstart job. A specific reload job actually sends SIGUSR1 (graceful restart).
  • nethserver-base
    Changed Dashboard/Service UI module

Test case

The system behaviour must not change:
  • check slapd, nslcd, httpd-admin start when installed
  • check services start at boot
  • check services start/stop when enabled/disabled
  • check services stop when uninstalled

#7 Updated by Davide Principi over 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-lib-1.3.2-6.0git1c52af52.ns6.noarch.rpm
nethserver-lib-1.3.2-7.0git5fc049e2.ns6.noarch.rpm
nethserver-lib-1.3.2-8.0gitbbf81fe1.ns6.noarch.rpm
nethserver-directory-1.2.3-2.0gitd928addb.ns6.noarch.rpm
nethserver-ntopng-1.0.1-1.0gitc7376f62.ns6.noarch.rpm
nethserver-ntopng-1.0.1-2.0git931ac602.ns6.noarch.rpm
nethserver-httpd-admin-1.0.6-12.0git547b73e8.ns6.noarch.rpm
nethserver-base-1.4.3-8.0git2dc30599.ns6.noarch.rpm

#8 Updated by Davide Principi over 7 years ago

  • Status changed from ON_QA to TRIAGED
  • % Done changed from 70 to 20

#9 Updated by Davide Principi over 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

#10 Updated by Davide Principi over 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Modified

Now runlevel-adjust disables SysV scripts, if an Upstart job is defined. The previous patch in nethserver-lib|1c52af52 was incomplete.

#11 Updated by Davide Principi over 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-lib-1.3.2-8.0gitbbf81fe1.ns6.noarch.rpm

#12 Updated by Davide Principi over 7 years ago

  • Assignee set to Davide Principi

#13 Updated by Davide Principi over 7 years ago

  • Status changed from ON_QA to TRIAGED
  • % Done changed from 70 to 20

#14 Updated by Davide Principi over 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#15 Updated by Davide Principi over 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

#16 Updated by Davide Principi over 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-directory-1.2.3-6.0gitab344e58.ns6.noarch.rpm
nethserver-samba-1.3.6-2.0gitb26684ff.ns6.noarch.rpm

#17 Updated by Giacomo Sanchietti over 7 years ago

  • Assignee set to Giacomo Sanchietti

#18 Updated by Giacomo Sanchietti over 7 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90
Test cases:
  • check services start at boot OK
  • check services start/stop when enabled/disabled OK
  • check services stop when uninstalled OK
  • check slapd, nslcd installed OK
  • check httpd-admin start when installed OK but see Note below

Note

When upgrading nethserver-httpd-admin package, the httpd-admin service is still running but the system doesn't know the service pid:

[root@test ~]# status httpd-admin
httpd-admin start/running

In this state, the service can't be controlled using upstart. Here is a workaround to be added to upgrade notes:
 kilall httpd-admin
 signal-event runlevel-adjust

Marking as VERIFIED.

#19 Updated by Davide Principi over 7 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

In nethserver-updates:
nethserver-samba-1.4.0-1.ns6.noarch.rpm
nethserver-directory-1.3.0-1.ns6.noarch.rpm
nethserver-dnsmasq-1.1.0-1.ns6.noarch.rpm
nethserver-shorewall-1.0.3-1.ns6.noarch.rpm
nethserver-mail-server-1.5.0-1.ns6.noarch.rpm
nethserver-mail-filter-1.1.4-1.ns6.noarch.rpm
nethserver-nethgui-1.3.0-1.ns6.noarch.rpm
nethserver-base-1.5.0-1.ns6.noarch.rpm
nethserver-lib-1.4.0-1.ns6.noarch.rpm
nethserver-httpd-admin-1.1.0-1.ns6.noarch.rpm
nethserver-yum-1.2.0-1.ns6.noarch.rpm
nethserver-ntopng-1.1.0-1.ns6.noarch.rpm

Also available in: Atom PDF