Skip to content

Instantly share code, notes, and snippets.

@valtoni
Created March 22, 2021 10:57
Show Gist options
  • Save valtoni/0d93b15653a19ea54674df2f200b3128 to your computer and use it in GitHub Desktop.
Save valtoni/0d93b15653a19ea54674df2f200b3128 to your computer and use it in GitHub Desktop.
Output log to syslog in linux (init.d scripts)
# Original: https://serverfault.com/questions/341919/how-to-find-error-messages-from-linux-init-d-rc-d-scripts
# Reference: http://urbanautomaton.com/blog/2014/09/09/redirecting-bash-script-output-to-syslog/
exec 1> >(logger -s -t $(basename $0)) 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment