Your message dated Sun, 11 Jan 2026 23:20:22 +0000
with message-id <[email protected]>
and subject line Bug#1121135: fixed in runit 2.2.0-7
has caused the Debian Bug report #1121135,
regarding Please consider shipping enclosed wrapper for runit's 
/lib/runit/shutdown
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1121135: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121135
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: runit
Version: 2.2.0-6
Severity: wishlist
Tags: patch

Hi,

runit's shutdown(8) doesn't support scheduled shutdowns. This isn't normally
a problem (if you want, you can use at(1) to schedule a shutdown); but it
breaks the "Unattended-Upgrade::Automatic-Reboot-Time" feature of
unattended-upgrades.

I wrote a wrapper (in plain Bourne shell instead of zsh this time) for
runit's shutdown to support more of the features of systemd shutdown(8) more
or less transparently. This includes scheduled shutdowns (which are
implemented via at(1)). In my so far admittedly fairly minimal testing it
worked as intended.

Please consider including the wrapper in the runit package and enabling it
by default.

(I'd appreciate quick feedback on whether you will do this, because if not,
I'll build my own package, for my own use, that diverts runit's shutdown and
replaces it with my wrapper.)

Thanks!

András

-- System Information:
Init: runit (via /run/runit.stopit)

-- 
             When you starve with a tiger, the tiger starves last.
#!/bin/sh
#
# This is a wrapper around the /usr/lib/runit/shutdown that's shipped by the
# Debian runit package. Its purpose is to add support for reboot times
# other than "now", by way of scheduling the future reboot as an at(1) job;
# but while I'm at it I might as well add support for all the other systemd
# shutdown options as well.
#
# Copyright (c) 2025 András Korn.
#  
# Licensed under the GPL v3, or, at your option, and only if it's included
# in the runit package, under the BSD-3-clause license.

real_shutdown=/usr/lib/runit/shutdown.distrib
rundir=/run/runit/scheduled-shutdown
[ $# -eq 0 ] && exec "$real_shutdown"

wallmessage=""
timespec=""
wallonly=0
wall=1
shutdown_args=""

cancel_shutdown() {
        if cd "$rundir" 2>/dev/null; then
                j=$(echo *)
                if ! [ "$j" = "*" ]; then
                        atrm $j
                        ret=$?
                        rm $j
                        cd /    # currently superfluous as nothing that is run 
after calling cancel_shutdown is sensitive to PWD, but it's good hygiene
                        return $ret
                else
                        return 0
                fi
        else
                return 0
        fi
}

show_shutdown() {
        if cd "$rundir" 2>/dev/null; then
                j=$(echo *)
                if ! [ "$j" = "*" ]; then
                        timespec=$(cat $j | sort -t: -n -k1,1 -k2,2 | head -1)
                        echo "shutdown or reboot scheduled for $timespec, use 
'shutdown -c' to cancel."
                fi
        fi
        exit 0
}

while [ -n "$1" ]; do
        case "$1" in
                -[hrfFHP])                      shutdown_args="$shutdown_args 
$1";;
                now)                            shift; [ $# -gt 0 ] && 
wallmessage="${*}"; break;;
                -k)                             wallonly=1;;
                --no-wall)                      wall=0;;
                -c)                             cancel_shutdown; exit $?;;
                --show)                         show_shutdown;;         # 
doesn't return
                +[0-9]*|[012][0-9]:[0-5][0-9])  timespec="$1"; shift; [ $# -gt 
0 ] && wallmessage="${*}"; break;;
                *)                              echo "$0: WARNING: argument 
'$1' is unknown. Ignoring";;        # Ignore unknown arguments. Reasoning: it's 
better to be able to shut down without supporting some bell or whistle than to 
prevent shutdown.
        esac
        shift
done

case "$timespec" in
        "")             [ -n "$wallmessage" ] && [ "$wall" = 1 ] && wall "The 
system is going down NOW for: $wallmessage";;
        +[0-9]*)        timespec="$(date --date "now $timespec minutes" 
'+%H:%M')";;    # needs GNU date(1)
esac

if [ -n "$timespec" ]; then
        if [ -x /usr/bin/at ]; then
                # possible improvements: 1. include kind of shutdown in wall 
message (reboot or halt); 2. schedule some wall messages a few minutes before 
the actual shutdown.
                cd /    # make sure the pwd of the atjob is /, not some 
directory on e.g. a network fs
                if atoutput=$({
                        if [ "$wall" = 1 ]; then
                                if [ -n "$wallmessage" ]; then
                                        echo "wall 'The system is going down 
NOW for: $wallmessage'"
                                else
                                        echo "wall 'The system is going down 
NOW!'"
                                fi
                                [ "$wallonly" = 0 ] && echo "exec 
\"$real_shutdown\" $shutdown_args"
                        fi
                } | at "$timespec" 2>&1); then
                        jobnum=$(echo "$atoutput" | sed -n '/^job /{s/^job 
//;s/ .*//;p}')
                        case "$jobnum" in       # Is $jobnum an integer?
                                ''|*[!0-9]*)
                                        echo "$0: WARNING: I tried to schedule 
an at(1) job for $timespec to perform a 'shutdown $shutdown_args', and the job 
number is apparently '$jobnum', which is not an integer. I don't know what 
happened, or whether the shutdown will take place at the scheduled time. Please 
investigate." >&2;;
                                *)
                                        mkdir -p "$rundir"
                                        cancel_shutdown                         
# if there was a shutdown scheduled, cancel it -- we just scheduled a new one
                                        echo "$timespec" >"$rundir/$jobnum"     
# this is needed by show_shutdown and cancel_shutdown
                                        ;;
                        esac
                else
                        echo "$0: WARNING: I tried to schedule an at(1) job for 
$timespec to perform a 'shutdown $shutdown_args', and at(1) returned an error. 
The system will probably not shut down at the scheduled time. For your 
reference, here is the entire output of at(1):" >&2
                        echo "$atoutput" >&2
                        exit 2
                fi
        else
                echo "FATAL: can't schedule shutdown for $timespec because 
at(1) is apparently not available (/usr/bin/at can't be executed)." >&2
                exit 1
        fi
else
        if [ -n "$wallmessage" ] && [ "$wall" = 1 ]; then
                echo "wall 'The system is going down NOW for: $wallmessage'"
        else
                echo "wall 'The system is going down NOW!'"
        fi
        [ "$wallonly" = 0 ] && exec "$real_shutdown" $shutdown_args
fi
exit 0

--- End Message ---
--- Begin Message ---
Source: runit
Source-Version: 2.2.0-7
Done: Lorenzo Puliti <[email protected]>

We believe that the bug you reported is fixed in the latest version of
runit, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Lorenzo Puliti <[email protected]> (supplier of updated runit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 11 Jan 2026 16:55:47 +0100
Source: runit
Architecture: source
Version: 2.2.0-7
Distribution: unstable
Urgency: medium
Maintainer: Lorenzo Puliti <[email protected]>
Changed-By: Lorenzo Puliti <[email protected]>
Closes: 1107917 1121135
Changes:
 runit (2.2.0-7) unstable; urgency=medium
 .
   * runit-init: keep diverted manpages usable (Closes: #1107917)
   * shutdown:
     - support scheduled shutdown via shell wrapper.
          + Thanks: Andras Korn (Closes: #1121135)
     - adjust runit-init symlinks
   * rescan-test: drop psmisc B-D, use 'chpst -l' instead
   * invoke-run: stop using --force-sysv
   * d/copyright: update years
   * d/control: drop redundant rules-requires-root
   * cpsv - generic use:
     - skip services without a proper run file
     - don't test diff when force is used (a, s)
     - use sv.current as default source (CPSV_SOURCE)
     - fix d (diff) in services with log
   * cpsv - user services and service instances:
     - also sync user services with 's'
     - strip @username suffix from user instances (with 'p')
     - fix wrong symlink target in log/run (with 'p')
     - create supervise dirs as symlink for user services too
     - link env to user-runsvdir's env (user services, with 'p')
     - create .meta as directory for user instances, pupulate
       metafiles with symlinks
   * svlogd/run: adapt for user services
   * trigger_sv:
     - early support for user-services
     - upgrade: fix wrong logic in runsvdir detection
   * sv: adjust bash completion
   * cpsv: add bash completion
   * cpsv.8: update
   * autopkgtest testsuite:
      - add test for cpsv (cpsv-test)
      - add test for trigger_sv (trigger-sv)
Checksums-Sha1:
 3b9d6e2a8d45ff449319da2635507707c0ed5f29 2212 runit_2.2.0-7.dsc
 b8b45dbf0bd31dbd30e7a28dd60321937d6a1227 86900 runit_2.2.0-7.debian.tar.xz
 2d69c40a7afbe79b8646c528be52938b49be0ba2 7018 runit_2.2.0-7_amd64.buildinfo
Checksums-Sha256:
 c3e627dc080454636b4b85a80c19c651736a0ea61d61652124e0e00fb8cdbc58 2212 
runit_2.2.0-7.dsc
 c4e289ec6533c70bfd9ffee1c3f06da9ce4f5d95571ff047128bcc904cfcb2ea 86900 
runit_2.2.0-7.debian.tar.xz
 bc90358ec37e0737533fb33e805538c2688a9990c8ab2937a59f394541c2174a 7018 
runit_2.2.0-7_amd64.buildinfo
Files:
 c63dcf45e55faae2506152bc70319c01 2212 admin optional runit_2.2.0-7.dsc
 5fd61e2499aa0f2d5f1d333b57068801 86900 admin optional 
runit_2.2.0-7.debian.tar.xz
 cf9af7a05ad565c989095b66b68e0cdb 7018 admin optional 
runit_2.2.0-7_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE2ji91PGnrxOd1bVNxxYb07RU7gMFAmlkHUIACgkQxxYb07RU
7gOufRAAsAvCLW26+HlEJj1c28tBy+8JdE2q1n9FF9jKEt3DWOeipjcIEWE87jEu
OFuphJzePF0GTUejKsnLwbQOZ3KzUVF/+GIW8223kTXbMnGbkc7qegWIgGASv/F7
2Uj2/LTsrAT3ht6UTnZyFAzyIOX4hBlTayQioPfutYtjUur82kzPftBmf1GV+in9
jVkz9Ixl8aK32D+BPQ6xayIIjls9MRoTnK91aUOtkFtQBJZIUMqAQN5+Yexfrg5P
YU91vIqG0j1agtphGXwB8MRzN4f//fbPcemyzBjYTmGX700t1ErxtWwiVaKTLR7E
iCWsCDWXoURbbV3e2uywQ+wBT30V2Xy8CzkuSZeLDJ9U1FAi3SvcETBiZBBAICP8
VcyMVJz65i9cDzZcbAQC31hmnRNRyW4R0qnVQulNrrjLzsuS6vwv9WLcWWTQ/H/j
su0vlnE/10S/6yhfpM/YVS16k+p3sEmXk322YUTXQ/q91zWPD/gdf4DZm/8VRXCa
1Joq2YXuBgQR7f5UBMRPiSX+NZWJlP9ITqLvTNtpT1f9D7qPOKgRLQbKAipeuwUN
0k5E/QO9ahjV43bd36hXdsU5JTlwU8ydvDfhbg03+eJMHiVO/oCTIflRQABpXyeg
S66eRMyxjaZCaxEXWcwcxeMzGy64OuNU118yk+A26UaHJPX1dZU=
=RWIL
-----END PGP SIGNATURE-----

Attachment: pgpPT9CeeuDKN.pgp
Description: PGP signature


--- End Message ---

Reply via email to