Hi,

I think this is better to avoid an error when stopping an already stopped
oneshot service.

Mark

commit 5125062c9653b9a3be0462f889d62b9ef929d05a
Author: Mark Hindley <[email protected]>
Date:   Mon Sep 15 08:19:19 2025 +0100

    Avoid error when stopping already stopped oneshot which is no-op.

diff --git a/debian/init-d-script b/debian/init-d-script
index 7761426c..487fbc38 100755
--- a/debian/init-d-script
+++ b/debian/init-d-script
@@ -49,7 +49,7 @@ oneshot() {
                setup) mkdir -p "$IDS_RUNDIR" ;;
                start-pre) [ -f /$IDS_RUNDIR/$NAME.oneshot ] && exit ;;
                start-post) touch /$IDS_RUNDIR/$NAME.oneshot ;;
-               stop-pre) [ -f /$IDS_RUNDIR/$NAME.oneshot ] || exit ;;
+               stop-pre) [ ! -f /$IDS_RUNDIR/$NAME.oneshot ] && exit ;;
                stop-post) rm -f /$IDS_RUNDIR/$NAME.oneshot ;;
                status)
                        if [ -f /$IDS_RUNDIR/$NAME.oneshot ]; then

Reply via email to