[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache2 läuft bei mir auf Jessie nicht mehr



Peter Schütt <newsgroup@pstt.de> wrote:

> Nov 28 19:10:46 peter64 systemd[1]: Starting The Apache HTTP Server...
> Nov 28 19:10:46 peter64 apachectl[27880]: mktemp: failed to create directory 
> via template '/var/lock/apache2.XXXXXXXXXX': No such file or directory
> Nov 28 19:10:46 peter64 apachectl[27880]: chmod: missing operand after '755'

Das ist zumindest kein grundsätzliches Problem. Ich habe genug Systeme
auf Debian Jessie, sowohl neu installiert als auch geupdated, und auf
allen funktioniert Apache2.4 out-of-the-box.

Da muss etwas spezielles mit deinem System sein, dass hier ein Problem
auftritt.

Der fragliche Code ist in apache2ctl in der Funktion mkdir_chown() ab
Zeile 109. Das mktemp ist in Zeile 114 und eigentlich hätte der Code
schon gar nicht bis zum chmod in Zeile 115 kommen dürfen, denn ...

113     if [ "$STAT" = "" ] ; then
114         local TMPNAME=$(mktemp -d $DIR.XXXXXXXXXX) || exit 1
115         chmod 755 $TMPNAME || exit 1
116         chown $OWNER $TMPNAME || exit 1

... wenn mktemp mit einem Error sich beendet, sollte direkt "exit 1" und
damit das Ende von apache2ctl passieren.

Beispiel mit /bin/sh (als dash) als Shell:

$ XTMPNAME=$(false) || echo "Fehler!"
Fehler!

Aufgerufden wird mkdir_chown in Zeile 136:

136 [ ! -d ${APACHE_LOCK_DIR:-/var/lock/apache2} ] && mkdir_chown ${APACHE_RUN_USER:-www-data} ${APACHE_LOCK_DIR:-/var/lock/apache2}

Prüfe doch bitte einmal, auf was APACHE_RUN_USER und APACHE_LOCK_DIR in
/etc/apache2/envvars gesetzt sind.

Auf einen normalen Debian Jessie sollte das so aussehen:

 13 # Since there is no sane way to get the parsed apache2 config in scripts, some
 14 # settings are defined via environment variables and then used in apache2ctl,
 15 # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
 16 export APACHE_RUN_USER=www-data
 17 export APACHE_RUN_GROUP=www-data
 18 # temporary state file location. This might be changed to /run in Wheezy+1
 19 export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
 20 export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
 21 export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
 22 # Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
 23 export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

S°

-- 
Sigmentation fault. Core dumped.


Reply to: