Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7503

Troubleshooting • cloud-init: do your first-boot config and go away -- how?

$
0
0
I have several RPi boxes around my shop doing various things. Last weekend, I finally took the time to upgrade all of them to Deb 13/trixie. What is all this cloud-init stuff?

I understand that cloud-init is being used as a first-boot configuration tool; however, it clearly does things beyond just first boot. The immediate pain point is its managing of my /etc/hosts file BEYOND first boot. (I can only wonder what else it's modifying/reverting on each boot.) I find all this quite annoying.

Despite being told that it is "... used for doing the initial setup of virtual machines in cloud computing ...", it's clearly doing more ...
A quick "find /etc/systemd -name '*cloud*'" gives me this:
  • /etc/systemd/system/cloud-init.target.wants
    /etc/systemd/system/cloud-init.target.wants/cloud-init-local.service
    /etc/systemd/system/cloud-init.target.wants/cloud-config.service
    /etc/systemd/system/cloud-init.target.wants/cloud-init-main.service
    /etc/systemd/system/cloud-init.target.wants/cloud-final.service
    /etc/systemd/system/cloud-init.target.wants/cloud-init-network.service
    /etc/systemd/system/cloud-config.target.wants
    /etc/systemd/system/cloud-config.target.wants/cloud-init-hotplugd.socket
... and "find /usr/lib/systemd -name '*cloud*'" gives me this:
  • /usr/lib/systemd/system-generators/cloud-init-generator
    /usr/lib/systemd/system/sshd-keygen@.service.d/disable-sshd-keygen-if-cloud-init-active.conf
    /usr/lib/systemd/system/cloud-init-local.service
    /usr/lib/systemd/system/cloud-config.target
    /usr/lib/systemd/system/cloud-config.service
    /usr/lib/systemd/system/cloud-init-main.service.d
    /usr/lib/systemd/system/cloud-init-main.service
    /usr/lib/systemd/system/cloud-init.target
    /usr/lib/systemd/system/cloud-final.service
    /usr/lib/systemd/system/cloud-init-hotplugd.service
    /usr/lib/systemd/system/cloud-init-network.service
    /usr/lib/systemd/system/cloud-init-hotplugd.socket
Worse - far worse, IMHO, a run of "systemctl | grep cloud" gives ...
  • cloud-config.service
    cloud-final.service
    cloud-init-local.service
    cloud-init-network.service
    cloud-init-hotplugd.socket
    cloud-config.target
    cloud-init.target
Yes; all but "cloud-init-hotplugd.socket" are "exited," but they're all enabled. How do I know what's going to trigger them?

If cloud-init is a first-boot configuration tool, why is it a service that remains enabled? (You only get one first-boot.) Why does it think my /etc/hosts file (and others perhaps; who knows!) needs ongoing, per-boot management? Why does Raspberry OS assume I'm in a server/cloud environment and want/need cloud-init beyond first-boot config?

Once my RPi goes through first boot (and cloud-init does its initial configuration), I want cloud-init and its brethren to go away completely and forever. (They're welcome to come back to do the first-boot configuration if and when I need to install a fresh image.)

So the only question I'm seeking an answer to is this:

After doing its first-boot configuration work, how do I make cloud-init et al. go away and stay away? I've searched the webs and I cannot find a clear answer. Too many of the sites returned are geared toward managing (non-RPi) servers running in a cloud environment and make no sense for what I have going on. (Or worse, I've been given several search results telling me to use raspi-config to modify cloud-init behavior yet raspi-config on Deb 13 hasn't any cloud-init options.)

Thanks in advance.

Statistics: Posted by PiSlicer — Sat Feb 21, 2026 6:53 pm — Replies 2 — Views 60



Viewing all articles
Browse latest Browse all 7503

Trending Articles