Skip to content

Commit 967c8d8

Browse files
authored
fix(config): ensure reboot works reliably on updating config (#106)
* fix stuck on reboot issue * remove duplicate jq command * spawn the reboot process in the rebootSystem function
1 parent 08ee786 commit 967c8d8

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ async function rebootSystem(): Promise<void> {
2424
return;
2525
}
2626

27-
const command = new Deno.Command("reboot", {
28-
stdout: "piped",
29-
stderr: "piped"
30-
});
31-
await command.output();
27+
// Use absolute path to the reboot command
28+
const command = new Deno.Command("/sbin/reboot");
29+
30+
// Spawn the process to run in the background and DO NOT await it.
31+
command.spawn();
3232
} catch (error) {
3333
console.error("Reboot command failed:", error);
3434
throw error;

scripts/runner.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
#!/bin/bash
2+
3+
# export essential GUI variables for systemd services
4+
export DISPLAY=:0
5+
export XDG_RUNTIME_DIR=/run/user/$(id -u)
6+
7+
# give the desktop a moment to settle
8+
sleep 5
9+
10+
# check to ensure URLs are there to load
11+
URLS=$(jq -r '.urls | map(.url) | join(" ")' /opt/piosk/config.json)
12+
if [ -z "$URLS" ]; then
13+
echo "No URLs found in config.json. Exiting runner."
14+
exit 0
15+
fi
16+
217
chromium-browser \
3-
$(jq -r '.urls | map(.url) | join(" ")' /opt/piosk/config.json) \
18+
$URLS \
419
--disable-component-update \
520
--disable-composited-antialiasing \
621
--disable-gpu-driver-bug-workarounds \

0 commit comments

Comments
 (0)