Scriptproblem

Michael Ring mring at ringnet.de
Tue Aug 27 10:06:01 CEST 2002


Hallo

Ich bin gerade dabei ein kleines Verwaltungsprogramm für meinen router in
PHP zu schreiben.
Nun hänge ich aber bei folgendem problem fest:
Irgendwo im Script steht folgendes
<?
# ...
exec("/etc/init.d/adsl restart", $ausgabe, $rueckgabe);
# ...
?>
Der Apache Errorlog meckert:
  /usr/sbin/pppd: no process killed
  /etc/init.d/adsl: line 17: /usr/sbin/pppd: Permission denied
  SIOCDELRT: Operation not permitted
Die zweite Zeile macht mir Kopfzerbrechen.
Ich habe keine Ahnung warum ich ein Permission Denied vom pppd bekomme.
Ich habe alle nötigen Programme in die /etc/sudo eingetragen:
www     ALL = /usr/ifconfig /usr/sbin/pppd /sbin/route /usr/bin/killall
/usr/sbin/pppoe /etc/init.d/adsl ALL

Mein /etc/init.d/adsl paste ich jetzt mal darunter:
#! /bin/sh
#
# /etc/init.d/adsl
#

PPPD="/usr/sbin/pppd"
PPPOE="/usr/sbin/pppoe"
ROUTE="/sbin/route"
KILLALL="/usr/bin/killall"
ADSL_DEVICE="eth0"

return=$rc_done

case "$1" in
    start)
        echo -n "Starting DSL (Flatrate): "
        $PPPD pty "$PPPOE -I $ADSL_DEVICE"
        $ROUTE del default
        echo -e "done."
        ;;
    stop)
        echo -n "Shutting down DSL (Flatrate): "
        $KILLALL $PPPD
        echo -e "done."
        ;;
    restart)
        $0 stop && $0 start
        ;;
    *)
        echo "Usage: $0 (start|stop|restart)"
        exit 1
esac

exit 0





More information about the Linux mailing list