diff --git a/citadel-realms/src/network.rs b/citadel-realms/src/network.rs index 48218da..78503e4 100644 --- a/citadel-realms/src/network.rs +++ b/citadel-realms/src/network.rs @@ -1,10 +1,11 @@ -use std::path::PathBuf; +use std::path::{Path,PathBuf}; use std::net::Ipv4Addr; use std::collections::{HashSet,HashMap}; use std::io::{BufReader,BufRead,Write}; use std::fs::{self,File}; use crate::Result; +use crate::realm::REALMS_RUN_PATH; const MIN_MASK: usize = 16; const MAX_MASK: usize = 24; @@ -58,7 +59,7 @@ impl NetworkConfig { /// /// Allocates IP addresses for a bridge shared by multiple realms. /// -/// State information is stored in /run/realms/network-$bridge as +/// State information is stored in /run/citadel/realms/network-$bridge as /// colon ':' separated pairs of realm name and allocated ip address /// /// realm-a:172.17.0.2 @@ -160,7 +161,7 @@ impl BridgeAllocator { } fn state_file_path(&self) -> PathBuf { - PathBuf::from(format!("/run/realms/network-{}", self.bridge)) + Path::new(REALMS_RUN_PATH).with_file_name(format!("network-{}", self.bridge)) } diff --git a/citadel-realms/src/realm.rs b/citadel-realms/src/realm.rs index 0176a2f..0e981d4 100644 --- a/citadel-realms/src/realm.rs +++ b/citadel-realms/src/realm.rs @@ -11,7 +11,7 @@ use crate::{RealmConfig,Result,Systemd,NetworkConfig,GLOBAL_CONFIG}; use crate::util::*; const REALMS_BASE_PATH: &str = "/realms"; -const REALMS_RUN_PATH: &str = "/run/realms"; +pub const REALMS_RUN_PATH: &str = "/run/citadel/realms"; #[derive(Clone)] pub struct Realm { @@ -362,7 +362,7 @@ impl RealmSymlinks { let path = runpath.join("current.realm"); if let Some(n) = name { - let tmp = Path::new("/run/current.realm.tmp"); + let tmp = Path::new("/run/citadel/current.realm.tmp"); let target = PathBuf::from(REALMS_BASE_PATH).join(format!("realm-{}", n)); symlink(&target, tmp) .map_err(|e| format_err!("failed to create symlink from {} to {}: {}", tmp.display(), target.display(), e))?;