Site Tools


staff-wiki:linux_centos

CentOS

Issues

Systemd/logind

There has been a pervasive issue with systemd and dbus causing the login service (systemd-logind) to fail. Major symptoms of this issue include

  • Slow or unresponsive logins - A server will take an abnormally long amount of time to allow logins, both over ssh or local tty logins.
  • Hostname is set to localhost.localdomain
  • Systemd services are unresponsive - Actions performed with the systemctl command timeout or otherwise fail returning messages about org.freedesktop.PolicyKit1.
dbus-daemon: dbus[996]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service'
dbus[996]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service'
systemd: Starting Authorization Manager...
systemd: polkit.service: main process exited, code=exited, status=1/FAILURE
systemd: Failed to start Authorization Manager.
systemd: Unit polkit.service entered failed state.
dbus-daemon: dbus[996]: [system] Failed to activate service 'org.freedesktop.PolicyKit1': timed out
dbus[996]: [system] Failed to activate service 'org.freedesktop.PolicyKit1': timed out

This problem can be resolved on a running system by running the following commands:

[root@localhost ~]# /usr/lib/polkit-1/polkitd &                      # First start the polkit daemon in the background
[root@localhost ~]# /bin/systemctl daemon-reload                     # Then reload the systemd daemon
[root@localhost ~]# /bin/systemctl restart systemd-logind.service    # Next restart the logind service
[root@localhost ~]# /bin/systemctl restart autofs                    # And autofs
[root@localhost ~]# hostname host01                                  # Finally set the hostname manually
[root@host01 ~]# 

The root cause of this issue is still unclear, but actions to correct the symptoms of this problem have been taken. A script has been pushed out to all CentOS systems using puppet called /root/fix-systemd.sh. This script will check to see if polkitd is running and if not execute the commands listed above.

To prevent systems from reaching this state to begin with, a systemd service has been created to run the /root/fix-systemd.sh one minute after boot time. If the polkitd process is not running then the problem will be fixed automatically.

cs-systemd-fix.service
[Unit]
Description=Fix Systemd nonsense
 
[Service]
Type=simple
ExecStart=/root/fix-systemd.sh
cs-systemd-fix.timer
[Unit]
Description=Runs cs-systemd-fix 1min after boot
 
[Timer]
# Time to wait after booting before activation
OnBootSec=1min
Unit=cs-systemd-fix.service
 
[Install]
WantedBy=multi-user.target

Deployment

See main article on CentOS Installation Instructions.

CentOS images are installed over network PXE boot. Before being able to boot from the network, the host must be entered into the DHCP/DNS management Portal, see Host Management for more information. After performing a PXE boot from a host, several options for install images are available.

Post Install Process

In order for puppet to correctly map the drives and complete the post install a new server must be added to the puppet manifest. The steps to add a server to puppet manifest are as follows:

  1. Log into coresrv04 as root
  2. cd /etc/puppetlabs/code/environments/<environment>/manifests
  3. there may already be a file there for the set of hosts. Edit that file. If not…
  4. cp Readme-Default-Linux.pp.txt hostname.pp
  5. edit the file, and add or change the host name
  6. on the new host run 'puppet agent -t'
  7. in /etc/puppetlabs/code/environments/<environment>/manifests run:
  8. - git add
  9. - git commit -m “comment explaining edit”
  10. - git push
staff-wiki/linux_centos.txt · Last modified: 2023/08/29 19:56 by 127.0.0.1