Closed kmecke closed 1 month ago
Can you generate the needed user on the command line?
sudo useradd -M vzlogger
Hi - yes that works fine.... Having said that... is the underscore the issue? I understood that the service user is _vzlogger? As mentioned here.
I just created the _vzlogger user as well, without issues. So I guess the modified regex pattern in adduser.conf has some effect.
Surprise.. here wo go:
vz2@rpi:/usr/local/bin $ sudo dpkg --configure -a
Setting up vzlogger (0.8.7) ...
Created symlink /etc/systemd/system/multi-user.target.wants/vzlogger.service → /lib/systemd/system/vzlogger.service.
vz2@rpi:/usr/local/bin $
So I guess the workaround works now.
As mentioned here.
Sorry. Missed that one.
So I guess the workaround works now.
Did you delete the created users before you retried installing the package?
If not, my bet is the needed user already existing "solved" the problem.
Hi - no, I did not delete the user. I think you are right. I feel like I am pretty close to get my volkszähler up an running... this weekend.
Shall I change the pattern back to the original expression too reproduce the issue in the installation process, or do you have enough information? I think its a pretty small thing that breaks the package installation. Let me know if I can assist you...
In the meantime, I am a happy customer by adding the user manually ; ) I leave the ticket open and up to you how to proceed. Thanks for your support and your great work!
adduser maintainer from Debian here. Yes, to create a user with an underscore you need --force-badname, as mentioned in the error message.
@Zugschlus is there a best practice how to name "system"-users (without home directory) for Debian?
this was introduced by #628 https://github.com/volkszaehler/vzlogger/commit/8e28a5c61f27bbbc33f24105e197b4a9c406b136 detail: https://github.com/volkszaehler/vzlogger/pull/628/files#diff-ce3462eeac5a3c192b69b87295bf537536adfd72fdf8bac44d989ddfbed79ac0R15 it looks like the underscore username was recommended to @narc-Ontakac2 as a best practice... @narc-Ontakac2: can you comment?
as referenced in #628 : https://www.debian.org/doc/debian-policy/ch-opersys.html#users-and-groups
When maintainers choose a new hardcoded or dynamically generated username for packages to use, they should start this username with an underscore. This minimizes collisions with locally created user accounts.
this appears to entail that scripts generating such an account have to use --force-badname
, even if that seems strange.
I have asked about the issue on the Debian developer list. I'll fix this according to the outcome.
The script is creating a system user. Therefore
# System user- and groupnames are checked against this regular
# expression.
# Default: SYS_NAME_REGEX="^[a-z_][-a-z0-9_]*\$?$"
should be applied. This however allows a leading underscore. The above is however from Debian trixie. @kmecke What is your unmodified /etc/adduser.conf?
https://metadata.ftp-master.debian.org/changelogs//main/a/adduser/adduser_3.134_changelog
adduser (3.131) unstable; urgency=medium
- Fix a bug: system user names are now allowed to begin with an underscore. Thanks to Guillem Jover for spotting this. -- Marc Haber mh+debian-packages@zugschlus.de Tue, 07 Feb 2023 12:08:36 +0100
https://packages.debian.org/search?keywords=adduser&searchon=names&suite=all§ion=all
buster (oldoldstable) 3.118: all bullseye (oldstable) 3.118+deb11u1: all bookworm (stable) 3.134: all trixie (testing) 3.137: all sid (unstable) 3.137: all
so this should work on stable and beyond, and only break on oldstable. but @kmecke is installing on bullseye/oldstable. as of his log... if we want to support that, we need to add the force flag. i guess just adding it makes more sense than special-casing on the distribution or adduser-version.
Even though you, @r00t- have it all together, I still want to answer your @narc-Ontakac2 question, maybe 8 hrs late...
@kmecke What is your unmodified /etc/adduser.conf?
The regex line was a comment and the regex was missing the underscore. Last two lines:
# check user and group names also against this regular expression.
# NAME_REGEX="^[a-z][-a-z0-9_]*\$"
I felt reluctant to upgrade to stable, since lots of stuff on that Raspi 3B (PiHole, z-wave controller... soon volkszähler) seem to be tested toward bullseye. But you are right - its about time. Stable should stable enough for an dist-upgrade
Unfortunately the trixie man page for adduser states
--force-badname
--allow-badname
These are the deprecated forms of --allow-bad-names. It will be
removed during the release cycle of the Debian release after
bookworm.
So special-casing is needed unless we bet on the adduser maintainers being sloppy regarding their announcement.
Will be done, but since it is not completely trivial it might take a day.
@Zugschlus: as you are here anyway, do you have an idea of how this should be handled for packages that want to support old and new releases?
There is PR #679 by now, I do however still need to test it.
@kmecke In case you haven't upgraded yet - could you remove vzlogger, do a deluser _vzlogger
and install it again. The issue should be fixed in 0.8.8. However I haven't been able to test it.
Hi @narc-Ontakac2 - sorry, I did the upgrade (vzloggger still not running, but the user is not the issue I guess). I have a backup of the old system, but I will not find the time to restore it and test it soon (maybe in two weeks)...
I have a backup of the old system, but I will not find the time to restore it and test it soon (maybe in two weeks)...
Don't, that is too much effort.
Inzwischen hat auch der Test für die Installation auf bullseye mit piuparts geklappt.
After the package installation via cloudsmith as described in the Readme in section "Debian and Raspberry Pi OS Packages" everything works out nice, until the configuration of the package. I think there is just the option missing so that the user _vzlogger user will be created correctly.
My workaround, which does not work (but why?):
Maybe you want to change the username OR add the --force-badname
... and thank you for your great work at this project!