Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions beam-init/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ clap_complete.workspace = true

[lints]
workspace = true

[features]
unstable-pty = []
10 changes: 0 additions & 10 deletions beam-init/src/bin/beamctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use serde::de::DeserializeOwned;

use beam_init::api::{self, Probe};

#[cfg(feature = "unstable-pty")]
mod terminal;

struct Client {
Expand Down Expand Up @@ -132,7 +131,6 @@ enum Command {
#[arg(long)]
name: Option<String>,
#[arg(long)]
#[cfg(feature = "unstable-pty")]
pty: bool,
#[arg(trailing_var_arg = true, index = 1, required = true, num_args = 1.., value_hint = clap::ValueHint::CommandWithArguments)]
command: Vec<String>,
Expand Down Expand Up @@ -179,7 +177,6 @@ enum Command {
follow: bool,
},
/// Attach to the PTY of a running service
#[cfg(feature = "unstable-pty")]
Attach {
#[arg(index = 1)]
name: String,
Expand Down Expand Up @@ -260,11 +257,8 @@ fn main() {
name,
command,
liveness,
#[cfg(feature = "unstable-pty")]
pty,
} => {
#[cfg(not(feature = "unstable-pty"))]
let pty = false;
let name = name.unwrap_or_else(gen_name);
let _resp: api::CreateService = client
.post(
Expand All @@ -279,7 +273,6 @@ fn main() {
.unwrap_or_else(show_error_and_exit);
eprintln!("Started service {name}");

#[cfg(feature = "unstable-pty")]
if pty {
attach(client, name);
}
Expand Down Expand Up @@ -352,7 +345,6 @@ fn main() {
}
}
}
#[cfg(feature = "unstable-pty")]
Command::Attach { name } => {
let name = prefix_match(&client, name);
attach(client, name);
Expand All @@ -366,7 +358,6 @@ fn main() {
}

/// Attach to the given service
#[cfg(feature = "unstable-pty")]
fn attach(client: Client, name: String) {
let service: api::Service = client
.post(&format!("/service/{}/show", name), &name)
Expand Down Expand Up @@ -418,7 +409,6 @@ fn attach(client: Client, name: String) {
}

/// Retrieve a file descriptor over the dedicated socket
#[cfg(feature = "unstable-pty")]
fn get_fd_from_store(fdstore_idx: u64) -> Option<std::os::fd::OwnedFd> {
use std::io::Write;
use std::os::unix::net::UnixStream;
Expand Down
4 changes: 1 addition & 3 deletions beam-init/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ 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 env::var("BEAM_INIT_ENABLE_API").as_deref() == Ok("1") {
fdstore::FdStore::bind_socket().expect("failed to bind fdstore socket")
} else {
fdstore::FdStore::no_socket()
Expand Down