According to the bash manual, these should be available always, even if the os does not supply them

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2026-11-30 11:56:08 +00:00
parent e2702736b8
commit 932b5d7ed3
+13
View File
@@ -919,6 +919,19 @@ if service_nologs; then
service_logfile_err = '/dev/null' service_logfile_err = '/dev/null'
fi fi
# Same if one of the files isn't available
>> "$service_logfile_out" || {
printf 'WARNING: %s is not writable, defaulting to stdout.\n'
service_logfile_out = /dev/stdout
}
[[ "$service_logfile_out" == "$service_logfile_err" ]] || {
>> "$service_logfile_err" || {
printf 'WARNING: %s is not writable, defaulting to stderr.\n'
service_logfile_err = /dev/stderr
}
}
# Get the last recorded mainpid # Get the last recorded mainpid
if service_pidfile is file; then if service_pidfile is file; then
read -r service_pid < "$service_pidfile" read -r service_pid < "$service_pidfile"