mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-14 04:41:30 +00:00
replace proxmox_sys::systemd with proxmox_systemd calls
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
fa487e5352
commit
5985905eb8
@ -257,7 +257,7 @@ pub fn delete_datastore_disk(name: String) -> Result<(), Error> {
|
||||
}
|
||||
|
||||
// disable systemd mount-unit
|
||||
let mut mount_unit_name = proxmox_sys::systemd::escape_unit(&path, true);
|
||||
let mut mount_unit_name = proxmox_systemd::escape_unit(&path, true);
|
||||
mount_unit_name.push_str(".mount");
|
||||
crate::tools::systemd::disable_unit(&mount_unit_name)?;
|
||||
|
||||
@ -293,7 +293,7 @@ fn create_datastore_mount_unit(
|
||||
fs_type: FileSystemType,
|
||||
what: &str,
|
||||
) -> Result<String, Error> {
|
||||
let mut mount_unit_name = proxmox_sys::systemd::escape_unit(mount_point, true);
|
||||
let mut mount_unit_name = proxmox_systemd::escape_unit(mount_point, true);
|
||||
mount_unit_name.push_str(".mount");
|
||||
|
||||
let mount_unit_path = format!("/etc/systemd/system/{}", mount_unit_name);
|
||||
|
@ -282,7 +282,7 @@ pub fn create_zpool(
|
||||
if std::path::Path::new("/lib/systemd/system/zfs-import@.service").exists() {
|
||||
let import_unit = format!(
|
||||
"zfs-import@{}.service",
|
||||
proxmox_sys::systemd::escape_unit(&name, false)
|
||||
proxmox_systemd::escape_unit(&name, false)
|
||||
);
|
||||
crate::tools::systemd::enable_unit(&import_unit)?;
|
||||
}
|
||||
|
@ -598,7 +598,7 @@ pub struct DeviceLockGuard {
|
||||
// Uses systemd escape_unit to compute a file name from `device_path`, the try
|
||||
// to lock `/var/lock/<name>`.
|
||||
fn open_device_lock(device_path: &str) -> Result<std::fs::File, Error> {
|
||||
let lock_name = proxmox_sys::systemd::escape_unit(device_path, true);
|
||||
let lock_name = proxmox_systemd::escape_unit(device_path, true);
|
||||
|
||||
let mut path = std::path::PathBuf::from(crate::tape::DRIVE_LOCK_DIR);
|
||||
path.push(lock_name);
|
||||
|
Loading…
Reference in New Issue
Block a user