diff options
author | Karel Kočí <karel.koci@nic.cz> | 2021-06-07 19:25:06 +0200 |
---|---|---|
committer | Paul Spooren <mail@aparcar.org> | 2021-06-22 09:45:27 -1000 |
commit | cc7316d1e924977881f03a7cb5863b695f79d81e (patch) | |
tree | d0d15ee98f1a122a636e8233abbf16d06871ec18 /package/base-files/files | |
parent | 0b2c1997e988552a4bb52dda88eccf4896fbb61b (diff) | |
download | upstream-cc7316d1e924977881f03a7cb5863b695f79d81e.tar.gz upstream-cc7316d1e924977881f03a7cb5863b695f79d81e.tar.bz2 upstream-cc7316d1e924977881f03a7cb5863b695f79d81e.zip |
base-files: fix enabled for services with only STOP
There are services that have only STOP value set. They are executed only
on shutdown and it is common to use them for system cleanup. There is
one such service shipped directly with base-files, it is 'umount'. Those
work the same way as those with START but enabled does not report them
as enabled although it should have as they can be enabled and disabled
as any other service.
This also changes check from check for executable to check for symbolic
link. The implementation depends on those being links to service file
and it is much cleaner and direct to check for them being links.
Signed-off-by: Karel Kočí <karel.koci@nic.cz>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-x | package/base-files/files/etc/rc.common | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index f39b69464e..5dcbf5138d 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -55,7 +55,12 @@ enable() { enabled() { name="$(basename "${initscript}")" - [ -x "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" ] + name="${name##[SK][0-9][0-9]}" + { + [ -z "${START:-}" ] || [ -L "$IPKG_INSTROOT/etc/rc.d/S${START}$name" ] + } && { + [ -z "${STOP:-}" ] || [ -L "$IPKG_INSTROOT/etc/rc.d/K${STOP}$name" ] + } } depends() { |