Don't reload the systemd daemon when it's not needed.
This commit is contained in:
parent
10ee13b5b7
commit
542f0fea95
1 changed files with 19 additions and 15 deletions
|
|
@ -183,6 +183,7 @@ pub fn deactivate() -> Result<()> {
|
|||
let old_services = read_saved_services()?;
|
||||
log::debug!("{:?}", old_services);
|
||||
|
||||
if !old_services.is_empty() {
|
||||
let service_manager = systemd::ServiceManager::new_session()?;
|
||||
let job_monitor = service_manager.monitor_jobs_init()?;
|
||||
let timeout = Some(Duration::from_secs(30));
|
||||
|
|
@ -200,6 +201,9 @@ pub fn deactivate() -> Result<()> {
|
|||
// the systemd daemon is up-to-date
|
||||
log::info!("Reloading the systemd daemon...");
|
||||
service_manager.daemon_reload()?;
|
||||
} else {
|
||||
log::info!("No services to deactivate.");
|
||||
}
|
||||
|
||||
serialise_saved_services(&HashMap::new())?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue