MCPcopy
hub / github.com/saltstack/salt / _sysv_enabled

Function _sysv_enabled

salt/modules/systemd_service.py:362–373  ·  view source on GitHub ↗

A System-V style service is assumed disabled if the "startup" symlink (starts with "S") to its script is found in /etc/init.d in the current runlevel.

(name, root)

Source from the content-addressed store, hash-verified

360
361
362def _sysv_enabled(name, root):
363 """
364 A System-V style service is assumed disabled if the "startup" symlink
365 (starts with "S") to its script is found in /etc/init.d in the current
366 runlevel.
367 """
368 # Find exact match (disambiguate matches like "S01anacron" for cron)
369 rc = _root(f"/etc/rc{_runlevel()}.d/S*{name}", root)
370 for match in glob.glob(rc):
371 if re.match(r"S\d{,2}%s" % name, os.path.basename(match)):
372 return True
373 return False
374
375
376def _untracked_custom_unit_found(name, root=None):

Callers 3

get_enabledFunction · 0.85
get_disabledFunction · 0.85
enabledFunction · 0.85

Calls 3

_rootFunction · 0.85
_runlevelFunction · 0.70
matchMethod · 0.45

Tested by

no test coverage detected