Skip to content

Commit 2a5ca4b

Browse files
committed
fix(openrc): uninstall command
1 parent 002b6ec commit 2a5ca4b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/openrc.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ impl ServiceManager for OpenRcServiceManager {
8383
}
8484

8585
fn uninstall(&self, ctx: ServiceUninstallCtx) -> io::Result<()> {
86-
rc_update(
86+
// If the script is configured to run at boot, remove it
87+
let _ = rc_update(
8788
"del",
8889
&ctx.label.to_script_name(),
8990
[OsStr::new("default")],
90-
)
91+
);
92+
93+
// Uninstall service by removing the script
94+
std::fs::remove_file(service_dir_path().join(&ctx.label.to_script_name()))
9195
}
9296

9397
fn start(&self, ctx: ServiceStartCtx) -> io::Result<()> {

0 commit comments

Comments
 (0)