Recently apache2 fails to start at boot, but can be started OK manually
Chris Green
cl at isbd.net
Wed Oct 27 13:42:41 UTC 2021
On Wed, Oct 27, 2021 at 09:46:02PM +1100, Karl Auer wrote:
> On Wed, 2021-10-27 at 10:53 +0100, Colin Law wrote:
> > On Wed, 27 Oct 2021 at 10:36, Chris Green <cl at isbd.net> wrote:
> > > Jan 1 00:02:28 2820n.zbmc.eu 2820n: [Web]WebUI login success
> > > from IP 192.168.1.3 [Admin]
> > > Oct 26 13:42:11 esprimo apachectl[853]: (99)Cannot assign
> > > requested address: AH00072: make_sock: could not bind to address
> > > 192.168.1.3:80
> > > Oct 26 13:42:14 esprimo avahi-daemon[724]: Registering new
> > > address record for 192.168.1.3 on enp0s25.IPv4.
> > >
> > No it hasn't. The error is at 13:42:11 and the network is not up
> > till 13:42:14.
>
> Indeed. But that "login success" is a bit strange. If the address is
> not yet set up, how was an outbound connection from it possible? Unless
> that log entry is about a connection from a different system that has
> the same address (straw-clutching mode ON).
>
> Also odd that this started happening when "nothing changed". Suggests
> that something is now happening faster or slower than before, pushing
> Apache2 off the twig.
>
> I'd have though the Apache2 service would require the network layer to
> be ready before it was run. Chris, Does your apache2.service file
> contain "After=network.target"?
>
Yes, here's the whole file:-
root at esprimo# more ./systemd/system/multi-user.target.wants/apache2.service
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=https://httpd.apache.org/docs/2.4/
[Service]
Type=forking
Environment=APACHE_STARTED_BY_SYSTEMD=true
ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl graceful-stop
ExecReload=/usr/sbin/apachectl graceful
KillMode=mixed
PrivateTmp=true
Restart=on-abort
[Install]
WantedBy=multi-user.target
--
Chris Green
More information about the ubuntu-users
mailing list