Do not try to reload the systemd daemon when we are using --no-start-daemon (#365)
This commit is contained in:
parent
11834a3aab
commit
b7839953dc
1 changed files with 19 additions and 15 deletions
|
@ -98,7 +98,7 @@ impl ConfigureInitService {
|
||||||
Self::check_if_systemd_unit_exists(SERVICE_SRC, SERVICE_DEST).await?;
|
Self::check_if_systemd_unit_exists(SERVICE_SRC, SERVICE_DEST).await?;
|
||||||
Self::check_if_systemd_unit_exists(SOCKET_SRC, SOCKET_DEST).await?;
|
Self::check_if_systemd_unit_exists(SOCKET_SRC, SOCKET_DEST).await?;
|
||||||
},
|
},
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(target_os = "linux")]
|
||||||
InitSystem::None => {
|
InitSystem::None => {
|
||||||
// Nothing here, no init system
|
// Nothing here, no init system
|
||||||
},
|
},
|
||||||
|
@ -225,13 +225,15 @@ impl Action for ConfigureInitService {
|
||||||
},
|
},
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
InitSystem::Systemd => {
|
InitSystem::Systemd => {
|
||||||
execute_command(
|
if *start_daemon {
|
||||||
Command::new("systemctl")
|
execute_command(
|
||||||
.process_group(0)
|
Command::new("systemctl")
|
||||||
.arg("daemon-reload")
|
.process_group(0)
|
||||||
.stdin(std::process::Stdio::null()),
|
.arg("daemon-reload")
|
||||||
)
|
.stdin(std::process::Stdio::null()),
|
||||||
.await?;
|
)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
// The goal state is the `socket` enabled and active, the service not enabled and stopped (it activates via socket activation)
|
// The goal state is the `socket` enabled and active, the service not enabled and stopped (it activates via socket activation)
|
||||||
let socket_was_active = if is_enabled("nix-daemon.socket").await? {
|
let socket_was_active = if is_enabled("nix-daemon.socket").await? {
|
||||||
disable("nix-daemon.socket", true).await?;
|
disable("nix-daemon.socket", true).await?;
|
||||||
|
@ -296,13 +298,15 @@ impl Action for ConfigureInitService {
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
execute_command(
|
if *start_daemon {
|
||||||
Command::new("systemctl")
|
execute_command(
|
||||||
.process_group(0)
|
Command::new("systemctl")
|
||||||
.arg("daemon-reload")
|
.process_group(0)
|
||||||
.stdin(std::process::Stdio::null()),
|
.arg("daemon-reload")
|
||||||
)
|
.stdin(std::process::Stdio::null()),
|
||||||
.await?;
|
)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(ssl_cert_file) = ssl_cert_file {
|
if let Some(ssl_cert_file) = ssl_cert_file {
|
||||||
let service_conf_dir_path = PathBuf::from(format!("{SERVICE_DEST}.d"));
|
let service_conf_dir_path = PathBuf::from(format!("{SERVICE_DEST}.d"));
|
||||||
|
|
Loading…
Reference in a new issue