Page MenuHomePhabricator

`require_valid_service` to check service mask
ClosedPublic

Authored by thcipriani on Aug 9 2017, 5:10 PM.
Referenced Files
Unknown Object (File)
Mar 25 2023, 4:59 PM
Unknown Object (File)
Mar 25 2023, 10:20 AM
Unknown Object (File)
Mar 17 2023, 4:50 PM
Unknown Object (File)
Mar 4 2023, 11:29 AM
Unknown Object (File)
Feb 27 2023, 11:41 AM
Unknown Object (File)
Feb 20 2023, 5:36 PM
Unknown Object (File)
Feb 15 2023, 12:00 PM
Unknown Object (File)
Feb 9 2023, 4:05 PM
Subscribers

Details

Reviewers
mmodell
dduvall
demon
fgiunchedi
Group Reviewers
Release-Engineering-Team
Commits
rMSCA97a9610390a0: `require_valid_service` to check service mask
Patch without arc
git checkout -b D743 && curl -L https://phabricator.wikimedia.org/D743?download=true | git apply
Summary

Adds an optional config variable, require_valid_service to check if a
service exists or if a service is masked before attempting to restart
it.

The use-case is when we have a service like jobrunner that should not be
started in the non-active datacenter. Ideally we could mask the service
using puppet, set require_valid_service: True and scap would not
attempt to restart the service for those machines.

Doesn't quite fix, but is part of the fix for T129148.

Diff Detail

Repository
rMSCA Scap
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

LGTM, just a nit

scap/utils.py
699

You can show only a single property with --property and only its value with --value

use: systemctl show --property LoadState --value [service]

This revision is now accepted and ready to land.Aug 10 2017, 6:23 PM
This revision was automatically updated to reflect the committed changes.