Skip to content

Commit b579809

Browse files
dsteinkopfclaude
andcommitted
docs: correct the rationale for replacing BASH_SOURCE
On Venus OS /bin/sh is bash, so the original line worked. The change is portability hardening for a script that declares #!/bin/sh, not a bug fix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 9d09dff commit b579809

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

service/log/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22
exec 2>&1
33
#Script Directory
4-
# $0 instead of ${BASH_SOURCE[0]}: Venus OS runs busybox ash, which has no
5-
# BASH_SOURCE, so SCRIPT_DIR silently fell back to the current directory.
4+
# BASH_SOURCE and &> are bash-only in a #!/bin/sh script; they work today only
5+
# because /bin/sh is bash on Venus OS.
66
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
77
SCRIPT_DIR=$(realpath "$SCRIPT_DIR/../../")
88
SERVICE_NAME=$(basename "$SCRIPT_DIR")

service/run

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
#Script Directory
3-
# $0 instead of ${BASH_SOURCE[0]}: Venus OS runs busybox ash, which has no
4-
# BASH_SOURCE, so SCRIPT_DIR silently fell back to the current directory.
3+
# BASH_SOURCE and &> are bash-only in a #!/bin/sh script; they work today only
4+
# because /bin/sh is bash on Venus OS.
55
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
66
#Define the version filename
77
CODE_VERSION_FILE=$(realpath "$SCRIPT_DIR/../version.txt")
@@ -11,7 +11,6 @@ if [ -f "$CODE_VERSION_FILE" ]; then
1111
#If the file exists, print its contents to stdout
1212
cat "$CODE_VERSION_FILE"
1313
fi
14-
# exec so that supervise watches python itself. Without it the shell stays as
15-
# the supervised child, a restart leaves python orphaned, and the new process
16-
# dies with "Bus name already exists" until the old one is killed by hand.
14+
# exec so supervise watches python itself: otherwise a restart orphans python,
15+
# it keeps the D-Bus names, and the new process dies with "Bus name already exists".
1716
exec python "$(realpath "$SCRIPT_DIR/../dbus_opendtu.py")"

0 commit comments

Comments
 (0)