#1099097 start-stop-daemon should unbuffer its stdout/stderr

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Ian Jackson
Date:
2026-07-06 00:35:02 UTC
Severity:
normal
Tags:
#1099097#5
Date:
2025-02-28 10:18:21 UTC
From:
To:
start-stop-daemon it can fail to print its output due to daemonising
with data still in the stdio buffers.  ISTM tht the output should
always be timely, so unbuffering the streams is the right fix.

tag2upload-manager@tag2upload-manager-01:/srv/manager.tag2upload.debian.org$ service-t2usm stop
Stopped t2usm (pid 3232228).
tag2upload-manager@tag2upload-manager-01:/srv/manager.tag2upload.debian.org$ start-stop-daemon --start --oknodo --verbose --user tag2upload-manager --background --notify-await --notify-timeout 5 --chdir /srv/manager.tag2upload.debian.org/run --exec /srv/manager.tag2upload.debian.org/live/bin/t2usm -- -c /srv/manager.tag2upload.debian.org/live/Live.toml -c /home/tag2upload-manager/t2usm-adhoc.toml run-manager 2>&1 | cat
tag2upload-manager@tag2upload-manager-01:/srv/manager.tag2upload.debian.org$ service-t2usm stop
Stopped t2usm (pid 3232249).
tag2upload-manager@tag2upload-manager-01:/srv/manager.tag2upload.debian.org$ stdbuf -e0 -o0 start-stop-daemon --start --oknodo --verbose --user tag2upload-manager --background --notify-await --notify-timeout 5 --chdir /srv/manager.tag2upload.debian.org/run --exec /srv/manager.tag2upload.debian.org/live/bin/t2usm -- -c /srv/manager.tag2upload.debian.org/live/Live.toml -c /home/tag2upload-manager/t2usm-adhoc.toml run-manager 2>&1 | cat
Starting /srv/manager.tag2upload.debian.org/live/bin/t2usm...
Detaching to start /srv/manager.tag2upload.debian.org/live/bin/t2usm...
Waiting for notifications... (timeout 5sec 0nsec)
Detaching complete...
Child sent some notification...
-> Notification => ready for service.
tag2upload-manager@tag2upload-manager-01:/srv/manager.tag2upload.debian.org$

Thanks,
Ian.

#1099097#8
Date:
2026-07-06 00:33:22 UTC
From:
To:
Hi!

Bug #1099097 in package dpkg reported by you has been fixed in
the dpkg/dpkg.git Git repository. You can see the changelog below, and
you can check the diff of the fix at:

https://git.dpkg.org/cgit/dpkg/dpkg.git/diff/?id=790784c6a
---
s-s-d: Force line buffering for stdout in --start

When we are writing stdout to a stream that is not connected to a tty,
we should still perform line-buffering (instead of block buffering)
otherwise we are trading a reduced amount of syscalls for non-timely
output, which can be problematic if the program gets stuck, given that
we currently output debugging messages on stdout. (Although debugging
messages should probably be switched to be emitted to stderr.)

Closes: #1099097