cscholz
Goto Top

su Muss von einem Terminal gestartet werden

Nachdem ich einen Debian 3.1 Server auf Debian 4.0 geupdatet habe geht folgende eMail an den Postmaster raus:

Betreff: Cron <amavis@server> test -e /usr/sbin/amavisd-new-cronjob && /usr/sbin/amavisd-new-cronjob sa-sync
su: Muss von einem Terminal gestartet werden

hat irgendwer eine Iree woran das liegen könnte? Das script von amavisd-new-cronjob ist das original, wurde also nicht verändert...


/usr/sbin/amavisd-new-cronjob sa-sync
#!/bin/sh

# amavisd-new cronjob helper
#
# Run it as root or as the amavis user
#
# First parameter specifies which cronjob routine to run:
#               sa-sync:        spamassassin fast sync
#               sa-clean:       spamassassin cleanup

test -e /usr/bin/sa-learn || exit 0
test -e /usr/sbin/amavisd-new || exit 0

SUUSER="amavis"  
unset IFS

set -e
umask 022

# WATCH OUT FOR PROPER QUOTING LEVEL WHEN CALLING THIS!
do_amavis_cmd() {
        if [ "$(id -u -n)" != "${SUUSER}" ]; then  
                exec /bin/su -s /bin/sh - "${SUUSER}" -c "$*"  
        else
                # to get the same quoting level as the su path
                eval exec "$*"  
        fi
}

case $1 in
        sa-sync)
                do_amavis_cmd "/usr/bin/sa-learn --sync" '>/dev/null'  
                ;;
        sa-clean)
                do_amavis_cmd "/usr/bin/sa-learn --sync --force-expire" '>/dev/null'  
                ;;
        *)
                echo "$0: unknown cron routine $1" >&2  
                exit 1
                ;;
esac

exit 0

Content-Key: 60467

Url: https://administrator.de/contentid/60467

Printed on: April 16, 2024 at 21:04 o'clock

Mitglied: 16568
16568 Jun 05, 2007 at 12:43:35 (UTC)
Goto Top
Wie immer fehlen hier die netten Infos...

Script-Rechte, Datei-Besitzer, Gruppe...
(heißt ja, su ist das Problem...)


Lonesome Walker