diff --git a/components/builder-admin/habitat/plan.sh b/components/builder-admin/habitat/plan.sh index 7d98dd727f..fb4aa0cf57 100644 --- a/components/builder-admin/habitat/plan.sh +++ b/components/builder-admin/habitat/plan.sh @@ -8,7 +8,7 @@ pkg_bin_dirs=(bin) pkg_deps=(core/glibc core/openssl core/gcc-libs core/zeromq core/libsodium core/libarchive) pkg_build_deps=(core/protobuf core/protobuf-rust core/coreutils core/cacerts core/cargo-nightly core/rust core/gcc core/pkg-config) bin="bldr-admin" -pkg_svc_run="bin/$bin start -c ${pkg_svc_path}/config.toml" +pkg_svc_run="$bin start -c ${pkg_svc_path}/config.toml" do_prepare() { # Can be either `--release` or `--debug` to determine cargo build strategy diff --git a/components/builder-api-proxy/hooks/run b/components/builder-api-proxy/hooks/run deleted file mode 100644 index 4ffb9ec0a9..0000000000 --- a/components/builder-api-proxy/hooks/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# -exec 2>&1 -exec hab pkg exec core/nginx nginx -c {{pkg.svc_path}}/config/nginx.conf diff --git a/components/builder-api-proxy/plan.sh b/components/builder-api-proxy/plan.sh index 5cd02253fc..897ad87864 100644 --- a/components/builder-api-proxy/plan.sh +++ b/components/builder-api-proxy/plan.sh @@ -1,11 +1,17 @@ pkg_origin=core pkg_name=builder-api-proxy pkg_description="HTTP Proxy service fronting the Habitat Builder API service" -pkg_version=0.1.0 +pkg_version=$(cat "${PLAN_CONTEXT}/../../VERSION") pkg_maintainer="The Habitat Maintainers > $pkg_prefix/run + # We use chpst to ensure that the script works outside `hab-sup` + # for debugging purposes, or under a `hab-director`. + build_line "Writing ${pkg_prefix}/run script to run ${pkg_svc_run} as ${pkg_svc_user}:${pkg_svc_group}" + cat <> $pkg_prefix/run #!/bin/sh cd $pkg_svc_path if [ "\$(whoami)" = "root" ]; then exec chpst \\ - -U ${pkg_svc_user}:$pkg_svc_group \\ - -u ${pkg_svc_user}:$pkg_svc_group \\ - $pkg_prefix/$pkg_svc_run 2>&1 + -U ${pkg_svc_user}:${pkg_svc_group} \\ + -u ${pkg_svc_user}:${pkg_svc_group} \\ + ${pkg_svc_run} 2>&1 else - exec $pkg_prefix/$pkg_svc_run 2>&1 + exec ${pkg_svc_run} 2>&1 fi EOT - else - cat <> $pkg_prefix/run -#!/bin/sh -cd $pkg_svc_path - -exec $pkg_prefix/$pkg_svc_run 2>&1 -EOT - fi fi fi return 0 diff --git a/www/source/docs/create-plans.html.md.erb b/www/source/docs/create-plans.html.md.erb index 4248f465f1..6fb1b3872f 100644 --- a/www/source/docs/create-plans.html.md.erb +++ b/www/source/docs/create-plans.html.md.erb @@ -153,7 +153,7 @@ pkg_build_deps=(core/patch core/make core/gcc) pkg_bin_dirs=(bin) pkg_lib_dirs=(lib) pkg_expose=(80 443) -pkg_svc_run="bin/httpd -DFOREGROUND -f $pkg_svc_config_path/httpd.conf" +pkg_svc_run="httpd -DFOREGROUND -f $pkg_svc_config_path/httpd.conf" pkg_svc_user="root" do_build() {