-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
In enable_feature:
for suffix in feature_suffixes:
cmds.append("sudo systemctl unmask {}.{}".format(feature_name, suffix))
cmds.append("sudo systemctl enable {}.{}".format(feature_name, feature_suffixes[-1]))
cmds.append("sudo systemctl start {}.{}".format(feature_name, feature_suffixes[-1]))
While in disable_feature, this iteration looks wrong:
for suffix in reversed(feature_suffixes):
cmds.append("sudo systemctl stop {}.{}".format(feature_name, suffix))
cmds.append("sudo systemctl disable {}.{}".format(feature_name, feature_suffixes[-1]))
cmds.append("sudo systemctl mask {}.{}".format(feature_name, feature_suffixes[-1]))
My idea is to change to:
for suffix in reversed(feature_suffixes):
cmds.append("sudo systemctl stop {}.{}".format(feature_name, suffix))
cmds.append("sudo systemctl disable {}.{}".format(feature_name, suffix))
cmds.append("sudo systemctl mask {}.{}".format(feature_name, suffix))
Let's say,
telemetry has feature_suffixes = ['service', 'timer']
enable_feature:
sudo systemctl unmask t.service
sudo systemctl unmask t.timer
sudo systemctl enable t.timer
sudo systemctl start t.timer
=> ok
disable_feature:
sudo systemctl stop t.timer
sudo systemctl disable t.timer
sudo systemctl mask t.timer
sudo systemctl stop t.service
sudo systemctl disable t.timer ?? why do it again
sudo systemctl mask t.timer ??
With new change:
disable:
sudo systemctl stop t.timer
sudo systemctl disable t.timer
sudo systemctl mask t.timer
sudo systemctl stop t.service
sudo systemctl disable t.service
sudo systemctl mask t.service
dhcp has [service]
enable:
sudo systemctl unmask d.service
sudo systemctl enable d.service
sudo systemctl start d.service
=>ok
disable:
sudo systemctl stop d.service
sudo systemctl disable d.service
sudo systemctl mask d.service
=>ok
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed