Show the PID beside the syslog_id to aid debugging.
Signed-off-by: Daniel F. Dickinson <redacted>
# shellcheck source=net/nut/files/functions.sh.functions
. "${IPKG_INSTROOT}"/lib/functions.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t nut-usb-hotplug "Unable to source 'functions.sh' in 'libhid-ups' hotplug. Bailing"
+ logger -t nut-usb-hotplug[$$] "Unable to source 'functions.sh' in 'libhid-ups' hotplug. Bailing"
exit 1
}
# shellcheck source=net/nut/files/nut-common.sh.functions
. "${IPKG_INSTROOT}"/lib/functions/nut/nut-common.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t nut-usb-hotplug "Unable to source 'nut-common.sh' in 'libhid-ups' hotplug. Bailing"
+ logger -t nut-usb-hotplug[$$] "Unable to source 'nut-common.sh' in 'libhid-ups' hotplug. Bailing"
exit 1
}
# shellcheck source=net/nut/files/functions.sh.functions
. "${IPKG_INSTROOT}"/lib/functions.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t nut-cgi "Unable to source 'functions.sh'"
+ logger -t nut-cgi[$$] "Unable to source 'functions.sh'"
exit 1
}
# shellcheck source=net/nut/files/nut-common.sh.functions
. "${IPKG_INSTROOT}"/lib/functions/nut/nut-common.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t nut-cgi "Failed to load nut-common.sh"
+ logger -t nut-cgi[$$] "Failed to load nut-common.sh"
exit 1
}
local level="${4:-notice}"
local facility="${5:-daemon}"
- logger -t "$syslog_id" -p "${facility}.${level}" "'$reason' in '$current_script'" || {
+ logger -t "${syslog_id}[$$]" -p "${facility}.${level}" "'$reason' in '$current_script'" || {
# We use 'tr' as changing case via variable parameter substitution is not available in ash on OpenWrt
# shellcheck disable=SC2018,SC2019
level="$(echo "$level" | tr 'a-z' 'A-Z')"
# shellcheck source=net/nut/files/functions.sh.functions
. "${IPKG_INSTROOT}"/lib/functions.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t nut-monitor "Unable to source 'functions.sh' in 'nut-monitor'. Bailing"
+ logger -t nut-monitor[$$] "Unable to source 'functions.sh' in 'nut-monitor'. Bailing"
exit 1
}
# shellcheck source=net/nut/files/nut-common.sh.functions
. "${IPKG_INSTROOT}"/lib/functions/nut/nut-common.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t nut-monitor "Unable to source 'nut-common.sh' in 'nut-monitor'. Bailing"
+ logger -t nut-monitor[$$] "Unable to source 'nut-common.sh' in 'nut-monitor'. Bailing"
exit 1
}
# shellcheck source=net/nut/files/functions.sh.functions
. "${IPKG_INSTROOT}"/lib/functions.sh || {
- logger -t nut-sendmail-notify "Unable to source 'functions.sh' in 'nut-sendmail-notify'. Bailing"
+ logger -t nut-sendmail-notify[$$] "Unable to source 'functions.sh' in 'nut-sendmail-notify'. Bailing"
exit 1
}
# shellcheck disable=SC1094
# shellcheck source=net/nut/files/nut-common.sh.functions
. "${IPKG_INSTROOT}"/lib/functions/nut/nut-common.sh || {
- logger -t nut-sendmail-notify "Unable to source 'nut-common.sh' in 'nut-sendmail-notify'. Bailing"
+ logger -t nut-sendmail-notify[$$] "Unable to source 'nut-common.sh' in 'nut-sendmail-notify'. Bailing"
exit 1
}
local reason="$1"
local syslog_id="nut-sendmail-notify"
local message_prefix="Message was not sent"
- logger -t "$syslog_id" "${message_prefix}: $reason" || {
+ logger -t "${syslog_id}[$$]" "${message_prefix}: $reason" || {
printf "%s: %s: %s, and logging failed\n" "$syslog_id" "$message_prefix" "$reason" >&2
}
exit 1
# shellcheck source=net/nut/files/functions.sh.functions
. "${IPKG_INSTROOT}"/lib/functions.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t nut-serial-hotplug "Unable to source 'functions.sh' in 'nut-serial' hotplug. Bailing"
+ logger -t nut-serial-hotplug[$$] "Unable to source 'functions.sh' in 'nut-serial' hotplug. Bailing"
exit 1
}
# shellcheck source=net/nut/files/nut-common.sh.functions
. "${IPKG_INSTROOT}"/lib/functions/nut/nut-common.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t nut-serial-hotplug "Unable to source 'nut-common.sh' in 'nut-serial' hotplug. Bailing"
+ logger -t nut-serial-hotplug[$$] "Unable to source 'nut-common.sh' in 'nut-serial' hotplug. Bailing"
exit 1
}
# shellcheck source=net/nut/files/functions.sh.functions
. "${IPKG_INSTROOT}"/lib/functions.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t "nut-server" "FATAL: Unable to source 'functions.sh' in 'nut-server'"
+ logger -t "nut-server[$$]" "FATAL: Unable to source 'functions.sh' in 'nut-server'"
exit 1
}
# shellcheck source=net/nut/files/nut-common.sh.functions
. "${IPKG_INSTROOT}"/lib/functions/nut/nut-common.sh || {
# Before our sourcing error logging definitions are sourced
- logger -t "nut-server" "FATAL: Unable to source 'nut-common.sh' in 'nut-server'"
+ logger -t "nut-server[$$]" "FATAL: Unable to source 'nut-common.sh' in 'nut-server'"
exit 1
}
stop_service_if_no_instances() {
if service_active_no_instances "nut-server"; then
- logger -s -t "nut-server" "nut-server active with no instances"
+ logger -t "nut-server" "nut-server active with no instances"
# If "nut-server" is active with no instances
# We don't care about the exit code of procd_kill, and logging its
# stderr can aid debugging.