Author Topic: service cloud-final.service failing to load  (Read 4988 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
service cloud-final.service failing to load
« on: July 12, 2021, 05:57:20 AM »
Hi there,

Yesterday I've rebuilt Apache from 2.4.39 to 2.4.46 (due to problem with uploading images to wordpress sites) and then I've rebuilt the vHOSTS.
Ever since I'm getting the following error (also tried to restart the server twice, but still getting the same message every 15 minutes):

Quote
Restarted service cloud-final.service on zzz.com at Mon Jul 12 08:45:01 IDT 2021Job for cloud-final.service failed because the control process exited with error code. See "systemctl status cloud-final.service" and "journalctl -xe" for details.


Running command "systemctl status cloud-final.service" I'm getting this:

Quote

Jul 12 08:45:02 zzz.com systemd[1]: Starting Execute cloud user/final scripts...
Jul 12 08:45:03 zzz.com cloud-init[3295]: Cloud-init v. 19.4 running 'modules:final' at Mon, 12 Jul 2021 05:45:03 +0000. Up 544.70 seconds.
Jul 12 08:45:03 zzz.com cloud-init[3295]: Cloud-init v. 19.4 finished at Mon, 12 Jul 2021 05:45:03 +0000. Datasource DataSourceHetzner.  Up 544.90 seconds
Jul 12 08:45:03 zzz.com echo[3307]: try restart NetworkManager.service
Jul 12 08:45:03 zzz.com systemctl[3309]: Failed to reload-or-try-restart NetworkManager.service: Unit not found.
Jul 12 08:45:03 zzz.com systemd[1]: cloud-final.service: control process exited, code=exited status=5
Jul 12 08:45:03 zzz.com systemd[1]: Failed to start Execute cloud user/final scripts.
Jul 12 08:45:03 zzz.com systemd[1]: Unit cloud-final.service entered failed state.
Jul 12 08:45:03 zzz.com systemd[1]: cloud-final.service failed.


Anybody knows what's wrong and how to fix it?
« Last Edit: July 12, 2021, 06:00:37 AM by ring_c »

Offline
**
Re: service cloud-final.service failing to load
« Reply #1 on: July 13, 2021, 07:14:07 AM »
Ok, I've found the solution myself, leaving it here for future seekers.
I had to comment the following line in file /usr/lib/systemd/system/cloud-final.service:


Code: [Select]
ExecStartPost=/usr/bin/systemctl reload-or-try-restart NetworkManager.service

Now my file looks like this:


Code: [Select]
[Unit]
Description=Execute cloud user/final scripts
After=network-online.target cloud-config.service rc-local.service
Wants=network-online.target cloud-config.service
ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled


[Service]
Type=oneshot
ExecStart=/usr/bin/cloud-init modules --mode=final
RemainAfterExit=yes
TimeoutSec=0
KillMode=process
ExecStartPost=/bin/echo "try restart NetworkManager.service"
# TODO: try-reload-or-restart is available only on systemd >= 229
# ExecStartPost=/usr/bin/systemctl reload-or-try-restart NetworkManager.service


# Output needs to appear in instance console output
StandardOutput=journal+console


[Install]
WantedBy=cloud-init.target