PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Privoxy-Startskript unter SUSE 10.0



species007
22.09.06, 17:22
Hallo Leute, das unter [1] abgelegte Startskript von Privoxy führt zu den unter [2] beschriebenen Fehlermeldungen. Was läuft falsch, und wie muss das Skript geändert werden? Für mich sind das nur kryptische Zeilen ...

Die unter [2] genannten Zeilen sind hervorgehoben, damit ihr nicht zählen müsst ;-))

Vielen Danke,


Michael

[1]


PATH=/usr/local/sbin
P_NAME=Privoxy
# Path to executable.
P_DAEMON=privoxy
# Full path to location of Privoxy config file.
P_CONF_FILE=/usr/local/etc/privoxy/config
# Full path to PID file location. Location must be writable by
# whoever runs this script.
P_PIDFILE=/var/run/privoxy.pid
# If uncommented, this script will try to run as USER=privoxy, which
# may require special handling of config, *.action, trust, logfile,
# jarfile, and pidfile.
P_USER=privoxy

# If a privoxy user is specified, lets try that. /bin/sh does not seem to
# know about $UID.
if [ "$USER" = "root" ] && [ -n "$P_USER" ] && id $P_USER >/dev/null; then
P_OWNER=$P_USER
else
P_OWNER=$USER
fi

if [ ! -f $P_CONF_FILE ]; then
echo "Can't find $P_CONF_FILE, exiting."
exit 1
fi

case "$1" in

start)
if [ -f $P_PIDFILE ]; then
if kill -0 `cat $P_PIDFILE`; then
echo "Error: $P_NAME is already running, exiting."
exit 1
else
rm -f $P_PIDFILE
fi
fi

$P_DAEMON --pidfile $P_PIDFILE --user $P_OWNER $P_CONF_FILE 2>/dev/null

if [ $? -eq 0 ]; then
echo "Starting $P_NAME, OK."
else
echo "Starting $P_NAME, Failed."
rm -f $P_PIDFILE
fi
;;

restart)
$0 stop
$0 start
;;

stop)
test ! -f $P_PIDFILE && echo "No $P_PIDFILE file found, exiting." && exit 1
kill `cat $P_PIDFILE` && rm -f $P_PIDFILE && \
echo "Stopping $P_NAME, OK." || echo "Stopping $P_NAME, failed."
;;

*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;

esac

exit 0

-----------------------------------------------------------------------------------------------------------------------------------
[2]
./privoxy: line 109: cat: command not found
kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
./privoxy: line 113: rm: command not found
Starting Privoxy, Failed.
./privoxy: line 123: rm: command not found

species007
23.09.06, 18:20
Keiner eine Idee? Meiner Meinung nach sind da nur stupid irgendwelche Syntaxfehler auszumerzen - leider bin ich kein Shell-Programmierer ... :-(

Olleg
24.09.06, 15:56
Vielleicht hat der User "privoxy" kein Schreibrecht unter /var/run und kann deshalb kein PID-File anlegen.

Kleinhirn
24.09.06, 17:19
Hallo,

er sagt, er findet die Programme cat und rm nicht.
Sind die im Verzeichnis /bin vorhanden? Ansonsten hast Du vielleicht keine Berechtigung, diese auszuführen.

species007
24.09.06, 19:47
cat und rm sind beide vorhanden und sind von mir (normaler Benutzer, _nicht_ privoxy) auch ausführbar. Vielleicht liegt's daran, dass die Befehle im Skript beim Aufruf nicht richtig maskiert sind? Evtl. Anführungsstriche oder Klammerung?

Hab jetzt schon jede Menge probiert, aber nichts war zielführend. Wenn mich nicht alles täuscht, wird das Skript ja als Benutzer "privoxy" ausgeführt, oder? Also, das sollte man doch zum Laufen bringen können ...