Feature #2078

Lib: synchronize service status prop and running state

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

Status:CLOSEDStart date:07/23/2013
Priority:NormalDue date:07/23/2013
Assignee:-% Done:

100%

Category:nethserver-lib
Target version:v6.4-beta2
Resolution: NEEDINFO:No

Description

This feature is strictly related to #2067.

The adjust-services action must align the running state of a service to its "target state". Here the "target state" is the value of the service status prop in ConfigDB and the presence of the package that owns the service (installed or not). Pseudocode:


ForEach <daemon>:
 If <service target status is "enabled">
    If <daemon is stopped> Then 
      <start daemon>
    EndIf
 Else
    If <daemon is started> Then 
       <stop daemon>
       Next 
    EndIf
 EndIf

 <execute action>
EndForEach

  • If the service is stopped and status is enabled then start the service
  • If the service is running and status is disabled then stop the service
  • Execute the action (restart, reload...) this can be optimized in the future

All of this in addition to chkconfig calls, as stated by #2067.


Related issues

Related to NethServer 6 - Feature #2067: Lib: synchronize service status prop and chkconfig CLOSED 07/17/2013 07/17/2013
Related to NethServer 6 - Enhancement #2080: Use files instead of symlinks for services2adjust CLOSED
Related to NethServer 6 - Enhancement #2079: Base: bootstrap-console type default is "configuration" CLOSED 07/25/2013 07/25/2013
Related to NethServer 6 - Bug #2092: Could not start smb/slapd CLOSED 07/31/2013 07/31/2013

Associated revisions

Revision 50a19cd9
Added by Davide Principi about 8 years ago

runlevel-adjust action: moved to nethserver-lib project. Refs #2078

Revision 4274c800
Added by Davide Principi about 8 years ago

runlevel-adjust action: imported from nethserver-base project. Refs #2078

Revision 4f0cf859
Added by Davide Principi about 8 years ago

adjust-services, runlevel-adjust actions: use new NethServer::Service package. Refs #2078

History

#1 Updated by Davide Principi about 8 years ago

  • Due date set to 07/23/2013
  • Assignee set to Davide Principi
  • Target version set to v6.4-beta2
  • Start date set to 07/23/2013
  • Estimated time set to 4.00

#2 Updated by Davide Principi about 8 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

#3 Updated by Davide Principi about 8 years ago

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

#4 Updated by Davide Principi about 8 years ago

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

#5 Updated by Davide Principi about 8 years ago

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

Test case

Should not change dependant packages

In nethserver-testing:
  • nethserver-base-1.4.0-1.ns6.noarch.rpm
  • nethserver-lib-1.3.0-1.ns6.noarch.rpm
  • nethserver-yum-1.1.1-1.ns6.noarch.rpm
  • nethserver-nethgui-1.2.2-1.ns6.noarch.rpm

#6 Updated by Giacomo Sanchietti about 8 years ago

  • Assignee set to Giacomo Sanchietti

#7 Updated by Giacomo Sanchietti about 8 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

Tested with smartd service:

[root@test ~]# config setprop smartd status disabled
[root@test ~]# /etc/e-smith/events/actions/adjust-services nethserver-smartd-update
Shutting down smartd:                                      [  OK  ]
[INFO] smartd is disabled and has been stopped

[root@test ~]# /etc/e-smith/events/actions/adjust-services nethserver-smartd-update
[INFO] smartd is disabled: skipped

[root@test ~]# config setprop smartd status enabled
[root@test ~]# /etc/e-smith/events/actions/adjust-services nethserver-smartd-update
Starting smartd:                                           [  OK  ]
[INFO] smartd has been started

[root@test ~]# /etc/e-smith/events/actions/adjust-services nethserver-smartd-update
[INFO] service smartd restart
Shutting down smartd: [  OK  ]
Starting smartd: [  OK  ]

Marking as VERIFIED

#8 Updated by Davide Principi about 8 years ago

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

Moved to nethserver-updates repository

Also available in: Atom PDF