From 28401b589e37bd2d5721731048222f080e3288d1 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 30 Jan 2019 23:36:43 -0500 Subject: [PATCH] move /run/realms to /run/citadel/realms --- citadel-realms/src/network.rs | 7 ++++--- citadel-realms/src/realm.rs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) 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))?;