Help wanted to finalise wtmpdb init integration

Mark Hindley mark at hindley.org.uk
Wed Mar 5 12:36:22 GMT 2025


Something along these lines works for me:

do_start_prepare() {
  [ -f /run/$NAME.oneshot ] && exit
}

do_start_cleanup() {
  touch /run/$NAME.oneshot
}

do_stop_prepare() {
  [ -f /run/$NAME.oneshot ] || exit
}

do_stop_cleanup() {
  rm -fv /run/$NAME.oneshot
}

do_start_cmd_override() {
  /usr/bin/wtmpdb boot
}

do_stop_cmd_override() {
  /usr/bin/wtmpdb shutdown
}

If the approach is OK, I think the contents of the *_prepare() and *_cleanup()
functions could ultimately be added to init-d-script(5) and triggered by a
TYPE=oneshot or ONESHOT=yes flag or similar.

Mark



More information about the Debian-init-diversity mailing list