-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sled-agent] NTP zone config set up via zone-setup CLI (#5440)
## Overview This PR repurposes the zone-network CLI into a zone-setup CLI, in order to remove as many zone start-up scripts as possible. This is also in preparation to use this zone-setup CLI with the self assembling switch zone. Related: #1898 --------- Co-authored-by: Andy Fiddaman <[email protected]>
- Loading branch information
Showing
17 changed files
with
618 additions
and
448 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
File renamed without changes.
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,46 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> | ||
|
||
<service_bundle type='manifest' name='chrony-setup'> | ||
|
||
<service name='oxide/chrony-setup' type='service' version='1'> | ||
<create_default_instance enabled='true' /> | ||
|
||
<dependency name='multi_user' grouping='require_all' restart_on='none' | ||
type='service'> | ||
<service_fmri value='svc:/milestone/multi-user:default' /> | ||
</dependency> | ||
|
||
<exec_method type='method' name='start' | ||
exec='/opt/oxide/zone-setup-cli/bin/zone-setup chrony-setup -b %{config/boundary} -s %{config/server} -a %{config/allow}' | ||
timeout_seconds='0'> | ||
<method_context security_flags="aslr"> | ||
<method_credential user="root" group="root" | ||
privileges="basic,file_chown" /> | ||
</method_context> | ||
</exec_method> | ||
|
||
|
||
<property_group name='startd' type='framework'> | ||
<propval name='duration' type='astring' value='transient' /> | ||
</property_group> | ||
|
||
<property_group name="config" type="application"> | ||
<propval name="boundary" type="boolean" value="false" /> | ||
<propval name="server" type="astring" value="" /> | ||
<propval name="allow" type="astring" value="" /> | ||
</property_group> | ||
|
||
<stability value='Unstable' /> | ||
|
||
<template> | ||
<common_name> | ||
<loctext xml:lang='C'>Oxide Chrony Setup</loctext> | ||
</common_name> | ||
<description> | ||
<loctext xml:lang='C'>Configures chronyd for the NTP zone</loctext> | ||
</description> | ||
</template> | ||
</service> | ||
|
||
</service_bundle> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.