Skip to content

Commit b1cbb31

Browse files
committed
fix deploy replacing masked systemd units
1 parent 491584a commit b1cbb31

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ deploy-config:
107107

108108
deploy-systemd:
109109
scp deploy/systemd/*.service deploy/systemd/*.target $(JETSON_TARGET):/tmp/
110-
ssh $(JETSON_TARGET) 'sudo cp /tmp/genie-*.service /tmp/homeassistant.service /tmp/geniepod*.target /etc/systemd/system/ 2>/dev/null; \
110+
ssh $(JETSON_TARGET) 'for unit in /tmp/genie-*.service /tmp/homeassistant.service /tmp/geniepod*.target; do \
111+
sudo install -m 0644 "$$unit" "/etc/systemd/system/$$(basename "$$unit")"; \
112+
done; \
111113
sudo systemctl daemon-reload'
112114

113115
deploy-docker:

crates/genie-core/tests/tool_dispatch_test.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,22 @@ fn makefile_deploys_restart_helper() {
200200
);
201201
}
202202

203+
/// Verify systemd deploy replaces stale or masked unit-file symlinks.
204+
#[test]
205+
fn makefile_installs_systemd_units_instead_of_copying_through_symlinks() {
206+
let path = workspace_root().join("Makefile");
207+
let contents = std::fs::read_to_string(&path).unwrap();
208+
209+
assert!(
210+
contents.contains("sudo install -m 0644 \"$$unit\""),
211+
"Makefile should replace stale/masked unit files instead of copying through symlinks"
212+
);
213+
assert!(
214+
!contents.contains("sudo cp /tmp/genie-*.service"),
215+
"Makefile should not use cp for systemd units; cp follows masked-unit symlinks"
216+
);
217+
}
218+
203219
/// Verify the restart helper does not bounce llama.cpp on routine app updates.
204220
#[test]
205221
fn restart_helper_skips_llm_service() {

0 commit comments

Comments
 (0)