Skip to content

Commit ee6ae37

Browse files
committed
fix(launch): fix launchd_for_system
1 parent 2a5ca4b commit ee6ae37

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ jobs:
5353
- { rust: stable, os: ubuntu-latest, manager: systemd, test: systemd_for_user }
5454
- { rust: stable, os: ubuntu-latest, manager: systemd, test: systemd_for_system, elevated: sudo env PATH="$PATH" }
5555
- { rust: stable, os: macos-latest, manager: launchd, test: launchd_for_user }
56-
- { rust: stable, os: macos-latest, manager: launchd, test: launchd_for_system, elevated: sudo }
56+
- { rust: stable, os: macos-latest, manager: launchd, test: should_support_launchd_for_system_services, elevated: sudo, args: "--exact" }
57+
- { rust: stable, os: macos-latest, manager: launchd, test: should_support_launchd_for_system_services_running_as_specific_user, elevated: sudo, args: "--exact" }
5758
- { rust: stable, os: windows-latest, manager: sc, test: sc_for_system }
5859
- { rust: stable, os: windows-latest, manager: winsw, test: winsw_for_system }
5960
steps:
@@ -76,7 +77,7 @@ jobs:
7677
- name: Run ${{ matrix.test }} for ${{ matrix.manager }}
7778
run: |
7879
${{ matrix.elevated }} rustup default stable
79-
${{ matrix.elevated }} cargo test -p system-tests ${{ matrix.test }} -- --nocapture
80+
${{ matrix.elevated }} cargo test -p system-tests ${{ matrix.test }} -- ${{ matrix.args }} --nocapture
8081
# NOTE: This is disabled via `if: false` due to failures related to the test environment.
8182
test-freebsd:
8283
name: "Test Rust stable for ${{ matrix.test }} w/ ${{ matrix.manager }} (FreeBSD)"

src/launchd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl ServiceManager for LaunchdServiceManager {
127127

128128
// Unload old service first if it exists
129129
if plist_path.exists() {
130-
let _ = wrap_output(launchctl("unload", plist_path.to_string_lossy().as_ref())?);
130+
let _ = wrap_output(launchctl("remove", ctx.label.to_qualified_name().as_str())?);
131131
}
132132

133133
utils::write_file(

0 commit comments

Comments
 (0)