usermod: group 'systemd-journal' does not exist (only with FAI script)

Laura Smith n5d9xq3ti233xiyif2vp at protonmail.ch
Fri Sep 15 11:31:13 CEST 2023


I am getting this completely nonsensical error message when attempting to build a Debian Bookworm disk image.

My FAI build script (/srv/fai/config/scripts/...) has the following:
if [ $CREATE_USER -eq 1 ]; then
    $ROOTCMD adduser --comment "${USERN} - added with FAI" --shell /bin/bash --disabled-password $USERN
    $ROOTCMD usermod -a -G sudo,adm,systemd-journal $USERN
    $ROOTCMD chpasswd --encrypted <<< "${USERN}:${USERP}"
fi

This fails with error "usermod: group 'systemd-journal' does not exist".

But this makes zero sense.

1) The group clearly exists in Bookworm
cat /etc/group | fgrep system
systemd-journal:x:999:
systemd-network:x:998:
systemd-timesync:x:997:

2) If I run the same commands manually on a Bookworm system they run fine:
adduser --comment "test123" --shell /bin/false --disabled-password test123
Adding user `test123' ...
Adding new group `test123' (1001) ...
Adding new user `test123' (1001) with group `test123 (1001)' ...
Creating home directory `/home/test123' ...
Copying files from `/etc/skel' ...
Adding new user `test123' to supplemental / extra groups `users' ...
Adding user `test123' to group `users' ...
usermod -a -G sudo,adm,systemd-journal test123
echo $?


More information about the linux-fai mailing list