Skip to content

Commit

Permalink
fix(openbsd): Enable sysv init scripts in OpenBSD build script (canon…
Browse files Browse the repository at this point in the history
…ical#5790)

This replaces the use of `/etc/rc.local` in the OpenBSD build script
by the sysv init scripts provided with cloud-init.

Fixes canonicalGH-4036
LP: #1992853
  • Loading branch information
hcartiaux authored and holmanb committed Oct 22, 2024
1 parent 9c76610 commit a25026e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 23 deletions.
1 change: 0 additions & 1 deletion sysvinit/openbsd/cloudconfig.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ daemon_user=root

. /etc/rc.d/rc.subr

rc_bg="YES" # (undefined or "YES")
rc_usercheck="YES" # (undefined or "NO")

rc_start() {
Expand Down
1 change: 0 additions & 1 deletion sysvinit/openbsd/cloudfinal.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ daemon_user=root

. /etc/rc.d/rc.subr

rc_bg="YES" # (undefined or "YES")
rc_usercheck="YES" # (undefined or "NO")

rc_start() {
Expand Down
1 change: 0 additions & 1 deletion sysvinit/openbsd/cloudinit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ daemon_user=root

. /etc/rc.d/rc.subr

rc_bg="YES" # (undefined or "YES")
rc_usercheck="YES" # (undefined or "NO")

rc_start() {
Expand Down
1 change: 0 additions & 1 deletion sysvinit/openbsd/cloudinitlocal.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ daemon_user=root

. /etc/rc.d/rc.subr

rc_bg="YES" # (undefined or "YES")
rc_usercheck="YES"

rc_start() {
Expand Down
23 changes: 4 additions & 19 deletions tools/build-on-openbsd
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,9 @@ else
python3 setup.py install -O1 --distro openbsd --skip-build --init-system sysvinit_openbsd

echo "Installation completed."
RC_LOCAL="/etc/rc.local"
RC_LOCAL_CONTENT="

rm -rf /var/run/cloud-init
/usr/local/lib/cloud-init/ds-identify
cloud-init init --local
cloud-init init
cloud-init modules --mode config
cloud-init modules --mode final
"
if ! test -e $RC_LOCAL; then
echo "export PATH=$PATH:/usr/local/sbin:/usr/local/bin" >> $RC_LOCAL
echo "$RC_LOCAL_CONTENT" >> $RC_LOCAL
elif ! grep -Fq "cloud-init" $RC_LOCAL; then
echo "$RC_LOCAL_CONTENT" >> $RC_LOCAL
fi
rcctl enable cloudinitlocal
rcctl enable cloudinit
rcctl enable cloudconfig
rcctl enable cloudfinal
fi

0 comments on commit a25026e

Please sign in to comment.