Skip to content

Commit

Permalink
do not enable .service systemd unit if it has timer associated and
Browse files Browse the repository at this point in the history
if has no installation config (WantedBy=, RequiredBy=, Also=, Alias=
settings in the [Install] section
  • Loading branch information
tahmed-dev committed Aug 25, 2020
1 parent a2ad9c9 commit ed7f56f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions files/image_config/hostcfgd/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def update_feature_state(feature_name, state, has_timer):
start_cmds = []
for suffix in feature_suffixes:
start_cmds.append("sudo systemctl unmask {}.{}".format(feature_name, suffix))
start_cmds.append("sudo systemctl enable {}.{}".format(feature_name, suffix))
# If feature has timer associated with it, start corresponding systemd .timer unit
# otherwise, start corresponding systemd .service unit
# If feature has timer associated with it, start/enable corresponding systemd .timer unit
# otherwise, start/enable corresponding systemd .service unit
start_cmds.append("sudo systemctl enable {}.{}".format(feature_name, feature_suffixes[-1]))
start_cmds.append("sudo systemctl start {}.{}".format(feature_name, feature_suffixes[-1]))
for cmd in start_cmds:
syslog.syslog(syslog.LOG_INFO, "Running cmd: '{}'".format(cmd))
Expand Down

0 comments on commit ed7f56f

Please sign in to comment.