move /run/realms to /run/citadel/realms
This commit is contained in:
parent
d3ac4bb000
commit
28401b589e
@ -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))
|
||||
}
|
||||
|
||||
|
||||
|
@ -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))?;
|
||||
|
Loading…
Reference in New Issue
Block a user