Feature #2078
Lib: synchronize service status prop and running state
Status: | CLOSED | Start date: | 07/23/2013 | |
---|---|---|---|---|
Priority: | Normal | Due 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
isenabled
then start the service - If the service is running and
status
isdisabled
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
Associated revisions
runlevel-adjust action: moved to nethserver-lib project. Refs #2078
runlevel-adjust action: imported from nethserver-base project. Refs #2078
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