diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2025-06-16 08:23:27 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2025-06-23 07:43:13 +0000 |
| commit | bb3bc92f4df63bf4b071816de04605d3033e390a (patch) | |
| tree | 7cba059c134b82e27fd80ca8dbbce5205bb75399 /libexec/rc/rc.d | |
| parent | 5540b9eb9e2a560ba89e0a94ad665eaa8bf245cc (diff) | |
nuageinit: add a post network script
refactor nuageinit to allow a 3rd execution point during boot:
1. nuageinit is invoked before NETWORKING with a minimalistic network setup
for openstrack and potentially other network config setup. it tries
to configure everything which is not requiring any network.
2. nuageinit is invoked again post NETWORKING but pre SERVERS, in the
phase it does all that requires network, like dealing with packages.
Note that creating users have been moved to this phase to allow the
installation of shells like bash or zsh prior the creation of the
users, before that the user creation was failing if a non installed
shell was requested.
3. nuageinit will execute at the rc.local time all the specified scripts
and commands.
MFC After: 1 week
(cherry picked from commit 2a05d577ab30dcefcf51def4c65a64af30610c85)
Diffstat (limited to 'libexec/rc/rc.d')
| -rw-r--r-- | libexec/rc/rc.d/Makefile | 1 | ||||
| -rwxr-xr-x | libexec/rc/rc.d/nuageinit_post_net | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 23a3426e5d0a..ef2e7b43f9ed 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -317,6 +317,7 @@ SMRCDPACKAGE= sendmail .if ${MK_NUAGEINIT} != "no" CONFGROUPS+= NIUAGEINIT NIUAGEINIT= nuageinit \ + nuageinit_post_net \ nuageinit_user_data_script NIUAGEINITPACKAGE= nuageinit .endif diff --git a/libexec/rc/rc.d/nuageinit_post_net b/libexec/rc/rc.d/nuageinit_post_net new file mode 100755 index 000000000000..bea4c5e37c5f --- /dev/null +++ b/libexec/rc/rc.d/nuageinit_post_net @@ -0,0 +1,25 @@ +#!/bin/sh +# + +# PROVIDE: nuageinit_post_net +# REQUIRE: NETWORKING devfs +# BEFORE: SERVERS +# KEYWORD: firstboot + +. /etc/rc.subr + +name="nuageinit_post_net" +desc="Post Network Cloud Init configuration" +start_cmd="execute_post_net" +stop_cmd=":" +rcvar="nuageinit_enable" + +execute_post_net() +{ + test -f /var/cache/nuageinit/post_network_config || return + /usr/libexec/nuageinit /var/cache/nuageinit/post_network_config | tee -a /var/log/nuageinit.log +} + +# Share the same config as nuageinit +load_rc_config nuageinit +run_rc_command "$1" |
