fix live-build resolv.conf

This commit is contained in:
Aiden McClelland
2025-09-24 19:20:27 -06:00
parent 6f1900f3bb
commit ad5d3ad01d
5 changed files with 13 additions and 8 deletions

View File

@@ -132,8 +132,6 @@ async fn inner_main(
.await?; .await?;
rpc_ctx.shutdown().await?; rpc_ctx.shutdown().await?;
tracing::info!("RPC Context is dropped");
Ok(shutdown) Ok(shutdown)
} }

View File

@@ -76,6 +76,11 @@ pub struct RpcContextSeed {
pub start_time: Instant, pub start_time: Instant,
pub crons: SyncMutex<BTreeMap<Guid, NonDetachingJoinHandle<()>>>, pub crons: SyncMutex<BTreeMap<Guid, NonDetachingJoinHandle<()>>>,
} }
impl Drop for RpcContextSeed {
fn drop(&mut self) {
tracing::error!("RpcContext is dropped");
}
}
pub struct Hardware { pub struct Hardware {
pub devices: Vec<LshwDevice>, pub devices: Vec<LshwDevice>,
@@ -269,7 +274,7 @@ impl RpcContext {
self.crons.mutate(|c| std::mem::take(c)); self.crons.mutate(|c| std::mem::take(c));
self.services.shutdown_all().await?; self.services.shutdown_all().await?;
self.is_closed.store(true, Ordering::SeqCst); self.is_closed.store(true, Ordering::SeqCst);
tracing::info!("RPC Context is shutdown"); tracing::info!("RpcContext is shutdown");
Ok(()) Ok(())
} }

View File

@@ -15,12 +15,12 @@ use futures::future::BoxFuture;
use futures::stream::FusedStream; use futures::stream::FusedStream;
use futures::{FutureExt, SinkExt, StreamExt, TryStreamExt}; use futures::{FutureExt, SinkExt, StreamExt, TryStreamExt};
use helpers::NonDetachingJoinHandle; use helpers::NonDetachingJoinHandle;
use imbl_value::{InternedString, json}; use imbl_value::{json, InternedString};
use itertools::Itertools; use itertools::Itertools;
use models::{ActionId, HostId, ImageId, PackageId}; use models::{ActionId, HostId, ImageId, PackageId};
use nix::sys::signal::Signal; use nix::sys::signal::Signal;
use persistent_container::{PersistentContainer, Subcontainer}; use persistent_container::{PersistentContainer, Subcontainer};
use rpc_toolkit::{CallRemoteHandler, Empty, HandlerArgs, HandlerFor, from_fn_async}; use rpc_toolkit::{from_fn_async, CallRemoteHandler, Empty, HandlerArgs, HandlerFor};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use service_actor::ServiceActor; use service_actor::ServiceActor;
use start_stop::StartStop; use start_stop::StartStop;
@@ -47,11 +47,11 @@ use crate::service::action::update_tasks;
use crate::service::rpc::{ExitParams, InitKind}; use crate::service::rpc::{ExitParams, InitKind};
use crate::service::service_map::InstallProgressHandles; use crate::service::service_map::InstallProgressHandles;
use crate::service::uninstall::cleanup; use crate::service::uninstall::cleanup;
use crate::util::Never;
use crate::util::actor::concurrent::ConcurrentActor; use crate::util::actor::concurrent::ConcurrentActor;
use crate::util::io::{AsyncReadStream, TermSize, create_file, delete_file}; use crate::util::io::{create_file, delete_file, AsyncReadStream, TermSize};
use crate::util::net::WebSocketExt; use crate::util::net::WebSocketExt;
use crate::util::serde::Pem; use crate::util::serde::Pem;
use crate::util::Never;
use crate::volume::data_dir; use crate::volume::data_dir;
use crate::{CAP_1_KiB, DATA_DIR}; use crate::{CAP_1_KiB, DATA_DIR};

View File

@@ -912,7 +912,7 @@ impl AsRef<Path> for TmpDir {
} }
impl Drop for TmpDir { impl Drop for TmpDir {
fn drop(&mut self) { fn drop(&mut self) {
if self.path.exists() { if self.path != PathBuf::new() && self.path.exists() {
let path = std::mem::take(&mut self.path); let path = std::mem::take(&mut self.path);
tokio::spawn(async move { tokio::spawn(async move {
tokio::fs::remove_dir_all(&path).await.log_err(); tokio::fs::remove_dir_all(&path).await.log_err();

View File

@@ -231,6 +231,8 @@ lb chroot
lb installer lb installer
lb binary_chroot lb binary_chroot
lb chroot_prep install all mode-apt-install-binary mode-archives-chroot lb chroot_prep install all mode-apt-install-binary mode-archives-chroot
echo "nameserver 127.0.0.1" > chroot/chroot/etc/resolv.conf
echo "nameserver 1.1.1.1" >> chroot/chroot/etc/resolv.conf # Cloudflare DNS Fallback
lb binary_rootfs lb binary_rootfs
cp $prep_results_dir/binary/live/filesystem.squashfs $RESULTS_DIR/$IMAGE_BASENAME.squashfs cp $prep_results_dir/binary/live/filesystem.squashfs $RESULTS_DIR/$IMAGE_BASENAME.squashfs