Hi Vincent,

On Fri, Jul 11, 2025 at 01:30:52PM +0200, Vincent Danjean wrote:
Le 11/07/2025 à 12:08, Marc Haber a écrit :
Adduser in preinst is a very unusual way, as the adduser maintainer I
can come up with an idea why that would be needed. I am interesting in
hearing an explanation why you are causing yourself this kind of pain.

I do not know either.
Git tells me that the change comes from me and I did not know why I did that.

Then it would probably be a good idea to have it in postinst.

Please consider moving your adduser call to postinst. That way you can
get rid of the Pre-depends AND lose the need for all that scaffolding.
In postinst, it should be enough to just use

adduser --system --comment "Debian OWFS system account" --home /var/lib/owfs

without any scaffolding, group creation and else and you should be just
fine. Anything else is probably a bug in adduser, let mek now about your
needs. Do you NEED the home directory? Maybe you can just omit that and
get /nonexistent as home directory.

I need Debian-ow user and group as it is referenced in a systemd service files
(to run two services). Depending on the hardware, the admin may need to give
access to some devices to the user or group.

You can do all that in postinst.

I do not need any home directory (I just check on a machine with owfs, 
/var/lib/owf does not even exist)

So, my invocation should be :

adduser --system --group --comment "Debian OWFS system account" Debian-ow

Is there a way to change the home directory to /nonexistent on machines where 
the account already exists?
(other that patching /etc/passwd with sed)

I would recommend not touching existing systems on upgrade. This is opening an entire new can of worms because you need to care about the local admin having done changes to the home directory consciously.

The above adduser call will exit silently with a zero exit code even if the user already exists with the old setting of home directory.

I plan to do the change in the git repo and to upload after the trixie release,
unless you tell me that this change must to pushed to trixie.

I would recommend having this in trixie.

I am currently on Debconf, so I can easily talk to the release team tomorrow about this issue if you want me to. Or are you here yourself?

Greetings
Marc


--
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

Reply via email to