mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-09 22:46:45 +00:00
398211a6ed
Ported from suse15-diskless, with the differences 16 forces: - dracut symlinks /lib/dracut/hooks to /var/lib/dracut/hooks, so a hook shipped at the old path replaces the symlink with a directory - there is no netconfig or /etc/sysconfig/network to hand the running address to, so the initramfs writes a NetworkManager keyfile instead. Without it NetworkManager claims the interface on its own terms and the tethered root filesystem goes away with the old address, and confignet never gets the chance to refine anything - the discovery loop retries without a delay, so a link that takes a moment to come up can exhaust all 30 tries before the first packet can go anywhere. Keep asking, as the el9 hook already does
34 lines
1.5 KiB
Bash
34 lines
1.5 KiB
Bash
#!/bin/sh
|
|
|
|
# This script is executed on each boot as it is
|
|
# completed. It is best to edit the middle of the file as
|
|
# noted below so custom commands are executed before
|
|
# the script notifies confluent that install is fully complete.
|
|
|
|
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
|
|
confluent_apikey=$(cat /etc/confluent/confluent.apikey)
|
|
confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
timedatectl set-timezone $(grep ^timezone: /etc/confluent/confluent.deploycfg|awk '{print $2}')
|
|
export nodename confluent_mgr confluent_profile
|
|
. /etc/confluent/functions
|
|
mkdir -p /var/log/confluent
|
|
chmod 700 /var/log/confluent
|
|
exec >> /var/log/confluent/confluent-onboot.log
|
|
exec 2>> /var/log/confluent/confluent-onboot.log
|
|
chmod 600 /var/log/confluent/confluent-onboot.log
|
|
tail -f /var/log/confluent/confluent-onboot.log > /dev/console &
|
|
logshowpid=$!
|
|
|
|
run_remote_python syncfileclient
|
|
run_remote_python confignet
|
|
run_remote onboot.custom
|
|
# onboot scripts may be placed into onboot.d, e.g. onboot.d/01-firstaction.sh, onboot.d/02-secondaction.sh
|
|
run_remote_parts onboot.d
|
|
|
|
# Induce execution of remote configuration, e.g. ansible plays in ansible/onboot.d/
|
|
run_remote_config onboot.d
|
|
|
|
printf 'state: booted\nstatus: booted' | curl -X POST --data-binary @- -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" https://$confluent_mgr/confluent-api/self/updatestatus
|
|
kill $logshowpid
|