2025-05-20 06:53:27 +01:00
#!/bin/sh
2025-05-05 15:08:36 +05:30
bad_users_groups=("cockpit-wsinstance-socket" "cockpit-session-socket")
failed=false
for gu in "${bad_users_groups[@]}"; do
2025-05-20 07:30:34 +01:00
grep -q "$gu" /etc/passwd
if [ $? -eq 0 ]; then
echo "user ${gu} exists, cockpit will fail to start up if this user exists, please run userdel ${gu} to resolve this"
failed=true
fi
2025-05-05 15:08:36 +05:30
2025-05-20 07:30:34 +01:00
grep -q "$gu" /etc/group
if [ $? -eq 0 ]; then
2025-05-05 15:08:36 +05:30
echo "group ${gu} exists, cockpit will fail to start up if this group exists, please run groupdel ${gu} to resolve this"
failed=true
fi
done
2025-05-20 07:30:34 +01:00
grep -q cockpit-systemd-service /etc/passwd
if [ $? -eq 0 ]; then
echo "user cockpit-systemd-service exists, cockpit will fail to start up if this group exists, please run userdel cockpit-systemd-service to resolve this"
2025-05-05 15:08:36 +05:30
failed=true
fi
2025-05-06 14:14:31 +05:30
if [ -f /etc/nsswitch.conf ]; then
2025-07-14 13:25:56 +05:30
grep -Eq "passwd:.*systemd" /etc/nsswitch.conf
2025-05-06 14:14:31 +05:30
if [ $? -ne 0 ]; then
echo "/etc/nsswitch.conf is out of date, please update it from /usr/etc/nsswitch.conf to use cockpit"
failed=true
fi
fi
2025-05-05 15:08:36 +05:30
if $failed; then
exit 1
fi