#978607 Please drop empty /etc/udev/udev.conf

Package:
udev
Source:
systemd
Description:
/dev/ and hotplug management daemon
Submitter:
Josh Triplett
Date:
2024-05-28 21:51:03 UTC
Severity:
minor
Tags:
#978607#3
Date:
2020-12-29 07:29:12 UTC
From:
To:
The systemd family of packages has generally tried to minimize the
number of files in /etc, in favor of files in /usr.

/etc/udev/udev.conf contains nothing but comments. Please consider
dropping it (when unmodified).

Thank you.

#978607#8
Date:
2020-12-29 11:51:47 UTC
From:
To:
Hi Josh

Am 29.12.20 um 08:29 schrieb Josh Triplett:

This is true for all config files shipped by both udev and systemd (i.e.
all files matching /etc/systemd/*.conf). All of them only contain
comments (i.e. commented out default values).
It feels a bit odd, to special-case udev here.
I have to add, that those files are provided by upstream.
I would feel more easy if this was discussed upstream. I don't really
want to deviate downstream here.

Regards,
Michael

#978607#13
Date:
2020-12-29 22:56:42 UTC
From:
To:
That's entirely fair. I reported it on udev because I was working with
udev at the time.

Of course.

It looks like those files are installed upstream by the
install-sysconfdir option, which also controls the installation of empty
.d directories and similar, and I think we want to keep the latter. I've
filed https://github.com/systemd/systemd/issues/18112 about the
possibility of splitting that option.

#978607#20
Date:
2021-02-02 05:59:22 UTC
From:
To:
I wrote a patch upstream, which has now been merged. Once that patch is
in Debian (whether backported or by shipping a new upstream version),
it'll just require setting install-sysconfdir=no-samples.

#978607#25
Date:
2024-05-27 16:11:51 UTC
From:
To:
On Mon, 1 Feb 2021 21:59:22 -0800 Josh Triplett <josh@joshtriplett.org> wrote:
<josh@joshtriplett.org> wrote:
empty
I've
is

Unfortunately it's not that simple, due to dpkg's idiosyncrasies, they
are "conffiles" so special handling is needed to remove them, with
postinst machinery and whatnot. If you test this and send a MR on Salsa
I will review it, but I will not do the work myself.

#978607#34
Date:
2024-05-28 09:34:08 UTC
From:
To:
I've always found such files useful for the user who wishes to
change the default configuration. This may be more visible than
the man page.

BTW, this file also provides documentation that is not present
in the man page:

# udevd is also started in the initrd.  When this file is modified you might
# also want to rebuild the initrd, so that it will include the modified configuration.

while there's nothing about initrd in the udev.conf(5) man page.

#978607#37
Date:
2024-05-28 17:19:05 UTC
From:
To:
Luca Bocassi wrote:

It turns out that dpkg-maintscript-helper isn't currently able to do
this. The current `rm_conffile` removes unmodified conffiles but renames
modified ones with a `.dpkg-bak` suffix. There's an open feature
request, https://bugs.debian.org/1006655 , requesting an
`rm_conffile_if_unmodified`. I think it'd be appropriate to wait on
that, which would then make this fairly trivial.

- Josh Triplett

#978607#40
Date:
2024-05-28 21:49:14 UTC
From:
To:
Josh Triplet wrote:

I wrote a patch for dpkg, implementing the `rm_conffile_if_unmodified`
mechanism, along with a declarative version.

If dpkg accepts that patch, and debhelper gets upgraded to support it in
package.maintscript files, then packages can use this by simultaneously
1) not installing the configuration file anymore, and
2) adding an appropriate `rm_conffile_if_unmodified` line to their
   package.maintscript file.