From 444b3b6fec85094c36b9ce1060ce67bf85ccc86a Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Wed, 3 Nov 2021 10:22:21 +0300 Subject: [PATCH] allow custom daemon startup prevention don't bother with /sbin/start-stop-daemon and /usr/sbin/policy-rc.d if they're not a regular files (e.g. symlinks) Signed-off-by: Konstantin Demin --- mmdebstrap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index ac95bd3..48e879d 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1290,7 +1290,7 @@ sub run_chroot { } # the file might not exist if it was removed in a hook - if (-e "$options->{root}/sbin/start-stop-daemon") { + if (-f "$options->{root}/sbin/start-stop-daemon") { if (-e "$options->{root}/sbin/start-stop-daemon.REAL") { error "$options->{root}/sbin/start-stop-daemon.REAL already" . " exists"; @@ -1318,7 +1318,7 @@ sub run_chroot { "$options->{root}/sbin/start-stop-daemon" ) or error "cannot move start-stop-daemon: $!"; } - if (-e "$options->{root}/usr/sbin/policy-rc.d") { + if (-f "$options->{root}/usr/sbin/policy-rc.d") { unlink "$options->{root}/usr/sbin/policy-rc.d" or error "cannot unlink policy-rc.d: $!"; }