Server fails to start after Centos 7 update

From Cor ad Cor
Jump to navigation Jump to search


The Problem

HTTPD failed after yum updated Centos 7.

SSH also failed.

I was able to access the server through an emergency console via the Rackspace cloud server interface.

network.service failed to bring up networking because /etc/sysconfig/network-scripts/ifcfg-eth0 was changed from "BOOTPROTO static" to "BOOTPROTO dhcp". The crucial piece of information in the screen capture is that "Determining IP information for eth0... failed."

I don't know whether the destruction of ifcfg-eth0 was done by "yum update all" or whether it was the result of my fumbling around before I took this screenshot.

Boot log errors

Starting LSB: Bring up/down netorking
Failed to start LSB: Bring up/down netowrking

servicectl status network.service

network.service - LSB: Bring up/down networking

failed

No DHCPOFFERS received.
Determining IP information for eth0... failed
I think I may have had both network.service and NetworkManager running. I made a mess out of the data before I understood this distinction.
I eventually decided to disable network.service and do my best to learn how NetworkManager works. It seems to be what RedHat wants.


Failed to start The Apache HTTP Server

Route info failed

Unexpected error

I had set both eth0 and eth1 as "defroute."


The Solutions

choose between network.service and NetworkManager.service

use nmtui to examine eth1 and configure eth0

- "Network configuration using sysconfig files."
- nmcli connection reload
- nmcli dev disconnect interface-name
- nmcli con up interface-name

configure /etc/sysconfig/network-scripts/ifcfg-eth0 to be static

stop cloud-init from rewriting ifcfg-eth0

start httpd after NetworkManager configures network

The final problem was that

#!/bin/sh
# This is a NetworkManager dispatcher script to turn http on
# when the network is ready.  MXM
# /etc/NetworkManager/dispatcher.d/22-httpd
# https://wiki.archlinux.org/index.php/NetworkManager#Network_services_with_NetworkManager_dispatcher

if [ "$2" = "up" ]; then
	systemctl start httpd
fi

if [ "$2" = "down" ]; then
	systemctl stop httpd
fi

exit 0