diff --git a/README.md b/README.md index 5ad8b7a..67e4d18 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,10 @@ and the container exits with the same status when that service exits. ```dockerfile COPY beam-init beamctl /usr/local/bin/ -ENV BEAM_INIT_ENABLE_API=1 ENTRYPOINT ["/usr/local/bin/beam-init"] CMD ["/usr/local/bin/my-app", "--listen", "0.0.0.0:8080"] ``` -`BEAM_INIT_ENABLE_API=1` enables the local Unix socket used by `beamctl` to interact with `beam-init`. - ```shell # Start and inspect an additional service. beamctl start --name my-app -- /usr/local/bin/my-app --listen 0.0.0.0:8080 diff --git a/beam-init/src/main.rs b/beam-init/src/main.rs index 05e3f1c..876ea57 100644 --- a/beam-init/src/main.rs +++ b/beam-init/src/main.rs @@ -71,18 +71,14 @@ async fn main() { let old_sigmask = signal_stream::init(&[SIGCHLD], tx_event.clone()) .expect("failed to initialize the signal stream"); - let fdstore = if cfg!(feature = "unstable-pty") - && env::var("BEAM_INIT_ENABLE_API").as_deref() == Ok("1") - { + let fdstore = if cfg!(feature = "unstable-pty") { fdstore::FdStore::bind_socket().expect("failed to bind fdstore socket") } else { fdstore::FdStore::no_socket() }; - if env::var("BEAM_INIT_ENABLE_API").as_deref() == Ok("1") { - // Listen for API commands - api_impl::bind_api_socket(tx_event.clone()).expect("failed to bind api socket"); - } + // Listen for API commands + api_impl::bind_api_socket(tx_event.clone()).expect("failed to bind api socket"); let mut service_manager = ServiceManager::new(old_sigmask, tx_event, fdstore); loop { diff --git a/test.Dockerfile b/test.Dockerfile index f0c6b6e..2480a31 100644 --- a/test.Dockerfile +++ b/test.Dockerfile @@ -24,7 +24,6 @@ RUN apt-get install --update -y python3 python3-psutil COPY --from=builder /beam-init /bin/init COPY --from=builder /beamctl /bin/beamctl -ENV BEAM_INIT_ENABLE_API=1 ENV BEAM_INIT_ENABLE_DEBUG_LOGS=1 ENV RUST_BACKTRACE=1