Help wanted to finalise wtmpdb init integration

Lorenzo plorenzo at disroot.org
Wed Mar 5 16:36:14 GMT 2025


On Wed, 5 Mar 2025 12:36:22 +0000
Mark Hindley <mark at hindley.org.uk> wrote:

> 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.
> 

I think standardize this in init-d-script would be a good idea, using
flag files or something else (if someone has a better idea).

Best,
Lorenzo

> Mark




More information about the Debian-init-diversity mailing list