Add IS_SYSTEMDUSERUNIT check

This commit is contained in:
Alexis Ben Miloud--Josselin 2022-05-10 16:43:19 +02:00
parent 7ff09cd973
commit b942cfd9f0

View file

@ -907,6 +907,15 @@ check_log2mailsystemdunit() {
&& failed "IS_LOG2MAILSYSTEMDUNIT" "/etc/init.d/log2mail may be deleted (use systemd unit)"
fi
}
check_systemduserunit() {
if is_debian_jessie || is_debian_stretch || is_debian_buster || is_debian_bullseye; then
awk 'BEGIN { FS = ":" } { print $1, $6 }' /etc/passwd | while read -r user dir; do
if ls "${dir}"/.config/systemd/user/*.service > /dev/null 2> /dev/null; then
failed "IS_SYSTEMDUSERUNIT" "systemd unit found for user ${user}"
fi
done
fi
}
check_listupgrade() {
test -f /etc/cron.d/listupgrade \
|| failed "IS_LISTUPGRADE" "missing listupgrade cron"
@ -1599,6 +1608,7 @@ main() {
test "${IS_BROADCOMFIRMWARE:=1}" = 1 && check_broadcomfirmware
test "${IS_HARDWARERAIDTOOL:=1}" = 1 && check_hardwareraidtool
test "${IS_LOG2MAILSYSTEMDUNIT:=1}" = 1 && check_log2mailsystemdunit
test "${IS_SYSTEMDUSERUNIT:=1}" = 1 && check_systemduserunit
test "${IS_LISTUPGRADE:=1}" = 1 && check_listupgrade
test "${IS_MARIADBEVOLINUXCONF:=0}" = 1 && check_mariadbevolinuxconf
test "${IS_SQL_BACKUP:=1}" = 1 && check_sql_backup