Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Set correct systemd default target
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedweber committed Aug 30, 2021
1 parent 2b3a628 commit 3b67ff7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
systemd manages restarts now and the Stackable agent cannot detect if
a service is in a restart loop ({263}).

=== Fixed
* Systemd services in session mode are restarted after a reboot ({263}).

== 0.5.0 - 2021-07-26

:224: https://github.com/stackabletech/agent/pull/224[#224]
Expand Down
12 changes: 10 additions & 2 deletions src/provider/systemdmanager/systemdunit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,15 @@ impl SystemDUnit {
}

// This one is mandatory, as otherwise enabling the unit fails
unit.set_property(Section::Install, "WantedBy", "multi-user.target");
unit.set_property(
Section::Install,
"WantedBy",
if user_mode {
"default.target"
} else {
"multi-user.target"
},
);

Ok(unit)
}
Expand Down Expand Up @@ -727,7 +735,7 @@ mod test {
TimeoutStopSec=30
[Install]
WantedBy=multi-user.target"#}
WantedBy=default.target"#}
)]
#[case::set_termination_timeout(
BusType::System,
Expand Down

0 comments on commit 3b67ff7

Please sign in to comment.