commit b9f45b1a838f62f1758632e9f2e07e3a21aca130 Author: Darren Austin Date: Thu Apr 12 19:57:19 2018 +0100 Initial commit diff --git a/README b/README new file mode 100644 index 0000000..ed6de37 --- /dev/null +++ b/README @@ -0,0 +1,11 @@ +What is it? +----------- + +Usage as a pipe logger with httpd VirtualHosts +---------------------------------------------- + +Usage as a raw pipe logger +------------------------- + +Usage with a fifo +----------------- diff --git a/TODO b/TODO new file mode 100644 index 0000000..0f39556 --- /dev/null +++ b/TODO @@ -0,0 +1,8 @@ +* Write a man page. +* Add a regex filter (read from a file) to decide what to log and what to drop. +* Instead of requiring a fifo already exist, if the file doesn't already exist create the fifo. + Would need to modify the trap for SIGTERM in order to clean up the file. +* Figure out a way to check if the program is respawning too offten - this would indicate an error in the calling process and + we don't want to just keep looping forever. +* Have an option to change UID and/or GID when running. Alternatively, use setpriv to drop capabilities. +* Make it so the symlink filename can contain the same escapes and {} as the template file. diff --git a/lumberjack b/lumberjack new file mode 100755 index 0000000..2ca9ecc --- /dev/null +++ b/lumberjack @@ -0,0 +1,491 @@ +#!/bin/bash +# Copyright (c) 2018: +# Darren 'Tadgy' Austin +# Licensed under the terms of the GNU General Public License version 3. +# +#........1.........2.........3.........4.........5.........6.........7.........8.........9.........0.........1.........2.........3.....:...4 + + +die() { + # $1 The text of the error message to display on stderr. + printf "%s: %s\n" "$LJ_NAME" "$1" >&2 + exit 1 +} + +display_help() { + # |--------1---------2---------3---------4---------5---------6---------7---------8 + cat <<-EOF + Usage: $LJ_NAME [options]