Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sled-agent] Fix bad merge, deleting unnecessary code #1114

Merged
merged 1 commit into from
May 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions sled-agent/src/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,76 +244,6 @@ impl ServiceManager {
let smf_name = format!("svc:/system/illumos/{}", service.name);
let default_smf_name = format!("{}:default", smf_name);

match service.name.as_str() {
"internal-dns" => {
info!(self.log, "Setting up internal-dns service");
let address =
service.addresses.get(0).ok_or_else(|| {
Error::BadServiceRequest {
service: service.name.clone(),
message: "Not enough addresses".to_string(),
}
})?;
running_zone
.run_cmd(&[
crate::illumos::zone::SVCCFG,
"-s",
&smf_name,
"setprop",
&format!(
"config/server_address=[{}]:{}",
address, DNS_SERVER_PORT
),
])
.map_err(|err| Error::ZoneCommand {
intent: "set server address".to_string(),
err,
})?;

running_zone
.run_cmd(&[
crate::illumos::zone::SVCCFG,
"-s",
&smf_name,
"setprop",
&format!(
"config/dns_address=[{}]:{}",
address, DNS_PORT
),
])
.map_err(|err| Error::ZoneCommand {
intent: "Set DNS address".to_string(),
err,
})?;

// Refresh the manifest with the new properties we set,
// so they become "effective" properties when the service is enabled.
running_zone
.run_cmd(&[
crate::illumos::zone::SVCCFG,
"-s",
&default_smf_name,
"refresh",
])
.map_err(|err| Error::ZoneCommand {
intent: format!(
"Refresh SMF manifest {}",
default_smf_name
),
err,
})?;
}
_ => {
info!(
self.log,
"Service name {} did not match", service.name
);
}
}

let smf_name = format!("svc:/system/illumos/{}", service.name);
let default_smf_name = format!("{}:default", smf_name);

match service.name.as_str() {
"internal-dns" => {
info!(self.log, "Setting up internal-dns service");
Expand Down