-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ntp start command works except for starting daemon bit
- Loading branch information
Showing
6 changed files
with
77 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
//! Utilities for interacting with chronyd. | ||
use crate::zone::CHRONYD; | ||
use crate::{execute, ExecutionError, PFEXEC}; | ||
|
||
/// Wraps commands for interacting with chronyd. | ||
pub struct Chronyd {} | ||
|
||
#[cfg_attr(any(test, feature = "testing"), mockall::automock)] | ||
impl Chronyd { | ||
pub fn start_daemon(file: &str) -> Result<(), ExecutionError> { | ||
let mut cmd = std::process::Command::new(PFEXEC); | ||
// TODO: This doesn't seem to be working. I think `execute()` | ||
// doesn't like the "&", and it immediately exits after running. | ||
// find a way to keep the process going. | ||
let cmd = cmd.args(&[CHRONYD, "-d", "-f", file, "&"]); | ||
execute(cmd)?; | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
//! Utilities for manipulating SMF services. | ||
use crate::zone::SVCADM; | ||
use crate::{execute, ExecutionError, PFEXEC}; | ||
|
||
/// Wraps commands for interacting with svcadm. | ||
pub struct Svcadm {} | ||
|
||
#[cfg_attr(any(test, feature = "testing"), mockall::automock)] | ||
impl Svcadm { | ||
pub fn refresh_logadm_upgrade() -> Result<(), ExecutionError> { | ||
let mut cmd = std::process::Command::new(PFEXEC); | ||
let cmd = cmd.args(&[SVCADM, "refresh", "logadm-upgrade"]); | ||
execute(cmd)?; | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters