titux
Goto Top

Apache 2 kompiliert - Unit für SytemD funktioniert nicht

Servus,

ich habe unter Centos 7 den Apache 2.4 über die Quellen kompiliert. Soweit so gut, ich kann den httpd Dienst mit dem "apachectl start" Befehl oder auch mit dem "httpd" Befehl starten und stoppen.

Nun möchte ich jedoch den automatischen Start des Dienstes erreichen u. scheitere gerade. Centos 7 benutzt ja SystemD als Init-Programm.
Auf einem zweiten Centos System habe ich einfach mal per yum den Apache2 installiert um mir die httpd.service unit als Beispiel zu nehmen, hat aber leider auch nicht funktioniert. Hier der Aufbau der unit:

[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Hier die Ausgabe von systemctl status httpd.service

[root@apache ~]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: activating (start) since Thu 2015-04-30 13:02:20 CEST; 32s ago
 Main PID: 2417 (httpd)
   CGroup: /system.slice/httpd.service
           ├─2417 /usr/sbin/httpd -DFOREGROUND
           ├─2418 /usr/sbin/httpd -DFOREGROUND
           ├─2419 /usr/sbin/httpd -DFOREGROUND
           └─2420 /usr/sbin/httpd -DFOREGROUND

Apr 30 13:02:20 apache.homebase.test systemd[1]: Starting The Apache HTTP Server...

Und die Ausgabe von journalctl -xn

[root@apache ~]# journalctl -xn
-- Logs begin at Thu 2015-04-30 12:57:16 CEST, end at Thu 2015-04-30 13:02:20 CEST. --
Apr 30 13:00:52 apache.homebase.test systemd[1]: Startup finished in 3.959s (kernel) + 14.399s (initrd) + 3min 22.212s (userspace) = 3min 40.572s.
-- Subject: System start-up is now complete
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- All system services necessary queued for starting at boot have been
-- successfully started. Note that this does not mean that the machine is
-- now idle as services might still be busy with completing start-up.
--
-- Kernel start-up required 3959914 microseconds.
--
-- Initial RAM disk start-up required 14399995 microseconds.
--
-- Userspace start-up required 202212774 microseconds.
Apr 30 13:01:01 apache.homebase.test systemd[1]: Starting Session 2 of user root.
-- Subject: Unit session-2.scope has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-2.scope has begun starting up.
Apr 30 13:01:01 apache.homebase.test systemd[1]: Started Session 2 of user root.
-- Subject: Unit session-2.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-2.scope has finished starting up.
--
-- The start-up result is done.
Apr 30 13:01:01 apache.homebase.test CROND[2392]: (root) CMD (run-parts /etc/cron.hourly)
Apr 30 13:01:01 apache.homebase.test run-parts(/etc/cron.hourly)[2395]: starting 0anacron
Apr 30 13:01:01 apache.homebase.test run-parts(/etc/cron.hourly)[2401]: finished 0anacron
Apr 30 13:01:01 apache.homebase.test run-parts(/etc/cron.hourly)[2403]: starting 0yum-hourly.cron
Apr 30 13:01:01 apache.homebase.test run-parts(/etc/cron.hourly)[2407]: finished 0yum-hourly.cron
Apr 30 13:01:26 apache.homebase.test systemd[1]: Stopped The Apache HTTP Server.
-- Subject: Unit httpd.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has finished shutting down.
Apr 30 13:02:20 apache.homebase.test systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.

Er läuft immer in einen Timeout, aber ich kann nicht rauslesen, weshalb.

Wer kennt sich hiermit aus u. kann mir einen Tipp geben?

Gruß
TiTux

Content-Key: 270760

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

Printed on: April 26, 2024 at 10:04 o'clock