Bug#1127467: sitesummary: correct debdiff

Hector Cao <[email protected]> Tue, 10 Feb 2026 13:03:24 +0100
Newsgroups gmane.linux.skolelinux.devel
Message-ID <CABjvBV7qvSEq_Q7a1FjV8ZMqGiDEPm+rvvJPON1vFX5h+Ee9VA__4716.39816403098$1770725151$gmane$org@mail.gmail.com>
--0000000000009f1b15064a770b24
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks Petter for this feedback,

I would agree with your suggestion.

Something like this ?

diff --git a/collect.d/system b/collect.d/system
index 9dc6fb9..5175aac 100644
--- a/collect.d/system
+++ b/collect.d/system
@@ -58,7 +58,9 @@ cat /proc/mounts > procmounts

 # Document current runlevel, useful to differenciate LTSP
 # thin clients from diskless workstations.
-runlevel > runlevel
+if command -v runlevel >/dev/null 2>&1; then
+    runlevel > runlevel
+fi

 # Throw away error message from laptop-detect using dmidecode in Xen
 # domUs.  See #438693 for more info.

On Tue, Feb 10, 2026 at 12:38=E2=80=AFPM Petter Reinholdtsen <[email protected]=
om>
wrote:

> [Hector Cao]
> > -runlevel > runlevel
> > +if command -v systemctl >/dev/null 2>&1 && [ -d /run/systemd/system ];
> then
> > +    systemctl list-units --type=3Dtarget --state=3Dactive > runlevel
> > +elif command -v runlevel >/dev/null 2>&1; then
> > +    runlevel > runlevel
> > +fi
>
> I believe this is the wrong approach.  The systemctl command is not
> presenting the current runlevel, it is presenting something else, and it
> belong in a diffferent file name.
>
> If the runlevel command do not exist, the runlevel file should not be
> created.  Changing the content of well known files place too much
> guesswork on the client code parsing the collected information.
>
> --
> Happy hacking
> Petter Reinholdtsen
>
>
>

--=20
Hector CAO
Software Engineer =E2=80=93 Server Team / Virtualization
[email protected]
https://launc <https://launchpad.net/~hectorcao>hpad.net/~hectorcao
<https://launchpad.net/~hectorcao>

<https://launchpad.net/~hectorcao>

--0000000000009f1b15064a770b24
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks Petter for this feedback,<div><br></div><div>I woul=
d agree with your=C2=A0suggestion.</div><div><br></div><div>Something like =
this ?</div><div><br></div><div>diff --git a/collect.d/system b/collect.d/s=
ystem<br>index 9dc6fb9..5175aac 100644<br>--- a/collect.d/system<br>+++ b/c=
ollect.d/system<br>@@ -58,7 +58,9 @@ cat /proc/mounts &gt; procmounts<br>=
=C2=A0<br>=C2=A0# Document current runlevel, useful to differenciate LTSP<b=
r>=C2=A0# thin clients from diskless workstations.<br>-runlevel &gt; runlev=
el<br>+if command -v runlevel &gt;/dev/null 2&gt;&amp;1; then<br>+ =C2=A0 =
=C2=A0runlevel &gt; runlevel<br>+fi<br>=C2=A0<br>=C2=A0# Throw away error m=
essage from laptop-detect using dmidecode in Xen<br>=C2=A0# domUs.=C2=A0 Se=
e #438693 for more info.</div></div><br><div class=3D"gmail_quote gmail_quo=
te_container"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Feb 10, 2026 at=
 12:38=E2=80=AFPM Petter Reinholdtsen &lt;<a href=3D"mailto:[email protected]=
">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex">[Hector Cao]<br>
&gt; -runlevel &gt; runlevel<br>
&gt; +if command -v systemctl &gt;/dev/null 2&gt;&amp;1 &amp;&amp; [ -d /ru=
n/systemd/system ]; then<br>
&gt; +=C2=A0 =C2=A0 systemctl list-units --type=3Dtarget --state=3Dactive &=
gt; runlevel<br>
&gt; +elif command -v runlevel &gt;/dev/null 2&gt;&amp;1; then<br>
&gt; +=C2=A0 =C2=A0 runlevel &gt; runlevel<br>
&gt; +fi<br>
<br>
I believe this is the wrong approach.=C2=A0 The systemctl command is not<br=
>
presenting the current runlevel, it is presenting something else, and it<br=
>
belong in a diffferent file name.<br>
<br>
If the runlevel command do not exist, the runlevel file should not be<br>
created.=C2=A0 Changing the content of well known files place too much<br>
guesswork on the client code parsing the collected information.<br>
<br>
-- <br>
Happy hacking<br>
Petter Reinholdtsen<br>
<br>
<br>
</blockquote></div><div><br clear=3D"all"></div><div><br></div><span class=
=3D"gmail_signature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_s=
ignature"><div dir=3D"ltr"><div style=3D"text-align:left"></div><div style=
=3D"text-align:left">Hector CAO<br></div><div style=3D"text-align:left">Sof=
tware Engineer =E2=80=93 Server Team / Virtualization</div><div style=3D"te=
xt-align:left"><a href=3D"mailto:[email protected]" target=3D"_blank=
">[email protected]</a></div><div style=3D"text-align:left"><a href=
=3D"https://launchpad.net/~hectorcao" target=3D"_blank">https://launc</a><a=
 href=3D"https://launchpad.net/~hectorcao" target=3D"_blank">hpad.net/~hect=
orcao</a></div><div style=3D"text-align:left">
<p style=3D"line-height:100%;margin-bottom:0in"> =20
<a href=3D"https://launchpad.net/~hectorcao" target=3D"_blank"><img width=
=3D"96" height=3D"81" src=3D"https://ci3.googleusercontent.com/mail-sig/AIo=
rK4z5yECcB4DOFqFQjPXjogBAVC5Vv1klgihEnAZXkqybF5lNxe9SeDqtm-9dmSwj3Sbw2kDL58=
U"></a></p>

</div></div></div>

--0000000000009f1b15064a770b24--