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)
| 360 | |
| 361 | |
| 362 | def _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 | |
| 376 | def _untracked_custom_unit_found(name, root=None): |
no test coverage detected