From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=5ltFZsvmpXoxH6ySai54iLvp4k6OfOFX48yzgIP/I+4=; b=g3kARjn08WcQV9HV1u4QrkIrrS+Uig+6PRkox9fdrk4k/UEIV+k0fiX3mffYC65oiK wzLmTaubIE/AtVVv1TaedNOIHGrtS3q33ZGhLdIHFCt1bX4AHR43V4Q2ADanECcHgxOZ EdNBNFzKxm4x2+lMOXZzl7ZXj4mm/+4abl/o6PoueNM7ZN1Eu/XzD9hO92qT2WmCtTSV DzzV3G+MHIVT17MqSK7BYTD7/Irlm6njfKhubIfZ88+UIACqDLOYYzZhpyUOaSteG9++ rBh6OUokjIHYiHjQoqy8r+8uxc4T5lVq8mGsb1+umCDWSinHBMb9HK5xqPAfxjj+0Jgc 4pOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=5ltFZsvmpXoxH6ySai54iLvp4k6OfOFX48yzgIP/I+4=; b=2q/s3fgrHAG4jW/f9TnLR5ci3QR4fv7A9bq6mzBXzXbgoLV4eGfAxNJIc5vRjKdLG4 bj/reRWDJOYUcOZv9aYD4WCinEatKPhB8jQDpSyaMz8oL1rfQigSgFkcBBEeEMUQBZiV NE92sbJmpwz1DcB3n8FyBmQRPDbvxjawfElbYIZ4MdMDTV7kSp2HBVvbqoJxwiRN5HAI o/cJO3sLBX4Qqa4sROzLTh47xJ8RiqzjwOHGkuWG6JEHS4vZqDYjN1+Wtb+TXpd+2ynq tp/X217YvOVyAwKXs070vANQ27pLG63rluqfghTboI4xCS794ywI7vn7hELwXLkuwWnX vkLw== X-Gm-Message-State: AOAM533lesvNX2b+HoDCf6TqWnHDdkTSdGLWAsoZBlttLPP3mSKxLB7z oKh/cVHSDqLdZBblL8TtgSaqQihvf74= X-Google-Smtp-Source: ABdhPJy9BojFx2s9cj6RAUNeth5xSmqQ79TN7g/glD1APK4qI2xt0Nc7C4Kfy+w04rA8vC6pJXLBHg== X-Received: by 2002:a05:6512:110a:: with SMTP id l10mr10193038lfg.550.1632499076049; Fri, 24 Sep 2021 08:57:56 -0700 (PDT) From: Leonid Krivoshein To: make-initrd@lists.altlinux.org Message-ID: <63a8378d-4447-ab1f-355f-0dc0d1ca072e@gmail.com> Date: Fri, 24 Sep 2021 18:57:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251; format=flowed Content-Language: ru Content-Transfer-Encoding: 7bit Subject: [make-initrd] [PATCH v1 23/41] fork pipeline: daemon splitted into first and second halfs X-BeenThere: make-initrd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: make-initrd@lists.altlinux.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2021 15:57:59 -0000 Archived-At: List-Archive: --- .../bootchain-core/data/sbin/bootchain-loop | 33 ------------ .../bootchain-core/data/sbin/bootchained | 51 +------------------ 2 files changed, 1 insertion(+), 83 deletions(-) diff --git a/make-initrd/features/bootchain-core/data/sbin/bootchain-loop b/make-initrd/features/bootchain-core/data/sbin/bootchain-loop index 1d30061..7f2e0fb 100755 --- a/make-initrd/features/bootchain-core/data/sbin/bootchain-loop +++ b/make-initrd/features/bootchain-core/data/sbin/bootchain-loop @@ -1,40 +1,7 @@ #!/bin/bash -efu -. shell-error -. shell-signal - -message_time=1 -pidfile="/var/run/$PROG.pid" -logfile="/var/log/$PROG.log" - -exit_handler() -{ - local rc="$?" - trap - EXIT - rm -f -- "$pidfile" - exit $rc -} - -[ ! -f "$pidfile" ] || - fatal "already running" - -set_cleanup_handler exit_handler -echo "$$" >"$pidfile" - . pipeline-sh-functions - -[ "${RDLOG-}" != 'console' ] || - logfile=/dev/console - -exec >"$logfile" 2>&1 -message "Starting server ..." - -mkdir -p -- "$mntdir" - -mountpoint -q "$mntdir" || - mount -t tmpfs tmpfs "$mntdir" ||: - pipenum=0 pipe="$PIPELINE" datadir= diff --git a/make-initrd/features/bootchain-core/data/sbin/bootchained b/make-initrd/features/bootchain-core/data/sbin/bootchained index 1d30061..21d97a8 100755 --- a/make-initrd/features/bootchain-core/data/sbin/bootchained +++ b/make-initrd/features/bootchain-core/data/sbin/bootchained @@ -35,53 +35,4 @@ mkdir -p -- "$mntdir" mountpoint -q "$mntdir" || mount -t tmpfs tmpfs "$mntdir" ||: -pipenum=0 -pipe="$PIPELINE" -datadir= -destdir= - -while [ -n "$pipe" ]; do - name="${pipe%%,*}" - exe="$handlerdir/$name" - - if [ -x "$exe" ]; then - eval "callnum=\"\${callnum_$name:-0}\"" - - datadir="$mntdir/src/pipe$pipenum" - destdir="$mntdir/dst/pipe$pipenum" - - [ "$pipenum" != 0 ] || - prevdir="" - - mkdir -p -- "$datadir" "$destdir" - - if ! mountpoint -q "$destdir"; then - message "[$callnum] Handler: $exe" - - export name callnum datadir destdir prevdir - - rc=0 - "$exe" || rc=$? - - if [ "$rc" != 0 ]; then - [ "$rc" != 2 ] || - break - message "[$callnum] Handler failed (rc=$rc)" - sleep 1 - continue - fi - else - message "[$callnum] Handler: $exe skipped" - fi - - prevdir="$destdir" - - callnum=$(($callnum + 1)) - eval "callnum_$name=\"\$callnum\"" - fi - - pipe="${pipe#$name}" - pipe="${pipe#,}" - - pipenum=$(($pipenum + 1)) -done +bootchain-loop -- 2.21.0