Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > e5d465274f61be6b970e2bf0c135df80 > files > 9

networkmanager-1.0.12-1.1.mga5.src.rpm

#!/bin/bash

# This script is written to avoid a deadlock on Mageia under systemd during boot.
# NetworkManager will try and restart nscd, but as it requires network.target to be
# complete, it will wait until it's ready.
# Sadly part of making network.target complete is network-up which will in turn
# call nmcli. As NM is busy waiting for the spawnprocess to complete, the nmcli
# will never return. Thus massive delays in boot are encountered.

if [ ! -x /usr/sbin/nscd ]; then
  exit 0
fi

if /bin/mountpoint -q /sys/fs/cgroup/systemd; then
  if /bin/systemctl --quiet is-active nscd.service; then
    /bin/systemctl restart nscd.service
    /usr/sbin/nscd -i hosts
  fi
else
  /etc/init.d/nscd condrestart
  /usr/sbin/nscd -i hosts
fi