From 52379fabc62a4ae2415a8b69ee143af8d841971d Mon Sep 17 00:00:00 2001 From: Zach Marano Date: Mon, 18 Jul 2016 13:20:55 -0700 Subject: Fix dependencies for init package and run instance_setup during postinst. --- google_compute_engine_init/build_packages.sh | 9 ++++++--- google_compute_engine_init/systemd/postinst.sh | 3 +++ google_compute_engine_init/sysvinit/postinst.sh | 3 +++ google_compute_engine_init/upstart/postinst.sh | 3 +++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/google_compute_engine_init/build_packages.sh b/google_compute_engine_init/build_packages.sh index 1d5131f..f4c80ea 100755 --- a/google_compute_engine_init/build_packages.sh +++ b/google_compute_engine_init/build_packages.sh @@ -20,7 +20,8 @@ function build_distro() { declare -r pkg_type="$2" declare -r init_config="$3" declare -r init_prefix="$4" - declare depends='google-compute-engine' + declare py_depends='google-compute-engine' + declare config_depends='google-config' declare file_pattern='*[^.sh]' declare init_files=(${init_config}/${file_pattern}) declare name='google-compute-engine-init' @@ -32,7 +33,8 @@ function build_distro() { done if [[ "${pkg_type}" == 'deb' ]]; then - depends="${depends}-${distro}" + py_depends="${py_depends}-${distro}" + config_depends="${config_depends}-${distro}" name="${name}-${distro}" fi @@ -41,7 +43,8 @@ function build_distro() { -t "${pkg_type}" \ --after-install "${init_config}/postinst.sh" \ --before-remove "${init_config}/prerm.sh" \ - --depends "${depends}" \ + --depends "${py_depends}" \ + --depends "${config_depends}" \ --description 'Google Compute Engine Linux initialization scripts' \ --iteration "0.${TIMESTAMP}" \ --license 'Apache Software License' \ diff --git a/google_compute_engine_init/systemd/postinst.sh b/google_compute_engine_init/systemd/postinst.sh index 66369fe..5913706 100755 --- a/google_compute_engine_init/systemd/postinst.sh +++ b/google_compute_engine_init/systemd/postinst.sh @@ -26,6 +26,9 @@ systemctl enable google-ip-forwarding-daemon.service systemctl enable google-shutdown-scripts.service systemctl enable google-startup-scripts.service +# Run instance setup. +systemctl start --no-block google-instance-setup + # Start daemons. systemctl start --no-block google-accounts-daemon systemctl start --no-block google-clock-skew-daemon diff --git a/google_compute_engine_init/sysvinit/postinst.sh b/google_compute_engine_init/sysvinit/postinst.sh index 281f6ee..e1cd77b 100755 --- a/google_compute_engine_init/sysvinit/postinst.sh +++ b/google_compute_engine_init/sysvinit/postinst.sh @@ -19,3 +19,6 @@ update-rc.d google-instance-setup defaults update-rc.d google-ip-forwarding-daemon defaults update-rc.d google-shutdown-scripts defaults update-rc.d google-startup-scripts defaults + +# Run instance setup. +/etc/init.d/google-instance-setup start diff --git a/google_compute_engine_init/upstart/postinst.sh b/google_compute_engine_init/upstart/postinst.sh index 5cbe3c8..0790b7e 100755 --- a/google_compute_engine_init/upstart/postinst.sh +++ b/google_compute_engine_init/upstart/postinst.sh @@ -18,6 +18,9 @@ stop --no-wait google-accounts-daemon stop --no-wait google-clock-skew-daemon stop --no-wait google-ip-forwarding-daemon +# Run instance setup +start --no-wait google-instance-setup + # Start daemons start --no-wait google-accounts-daemon start --no-wait google-clock-skew-daemon -- cgit v1.2.1