mirror of
https://git.proxmox.com/git/systemd
synced 2025-12-26 21:13:43 +00:00
Add a helper script debian/extra/make-sysusers-basic which generates a sysusers.d(5) file from Debian's static master passwd/group files. systemd 238 now supports specifying different uid and gid and a non-default login shell, so this is possible now. Closes: #888126
18 lines
601 B
Bash
Executable File
18 lines
601 B
Bash
Executable File
#!/bin/sh
|
|
# generate a sysusers.d(5) file from Debian's static master passwd/group files
|
|
set -eu
|
|
|
|
echo '# generated from /usr/share/base-passwd/{passwd,group}.master'
|
|
|
|
# only take groups whose name+gid != the corresponding user in passwd.master
|
|
export IFS=:
|
|
while read name _ id _; do
|
|
if ! grep -q "^$name:\*:$id:$id:" /usr/share/base-passwd/passwd.master; then
|
|
printf "g %-10s %-5s -\n" $name $id
|
|
fi
|
|
done < /usr/share/base-passwd/group.master
|
|
|
|
echo
|
|
|
|
awk -F: '{ i = ($3 == $4) ? $3 : $3":"$4; printf("u %-10s %-7s - %-20s %s\n", $1,i,$6,$7) }' < /usr/share/base-passwd/passwd.master
|