From b86c826101b3f1b0eca76a105f336b426d1827c8 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sat, 13 Jun 2020 14:57:54 +0100 Subject: [PATCH] Updates for v0.2.1. Add -o option to set the ownership of the pipe/FIFO when created by lumberjack. Move su/sg user/group changing after pipe/FIFO creation. Use -n rather than ! -z to quiet shellcheck. *sigh* Minor corrections of --help output. Add note about profiles to TODO list. --- TODO.md | 1 + lumberjack | 79 +++++++++++++++++++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/TODO.md b/TODO.md index 6507569..a1f55d8 100644 --- a/TODO.md +++ b/TODO.md @@ -1,2 +1,3 @@ * Write a man page. +* Profiles in a lumberjack.conf file? * Add a regex filter (read from a file) to decide what to log and what to drop. diff --git a/lumberjack b/lumberjack index bc77523..cce608d 100755 --- a/lumberjack +++ b/lumberjack @@ -8,7 +8,7 @@ # Script details. NAME="${0##*/}" -VERSION="0.2.0" +VERSION="0.2.1" # Functions. @@ -88,13 +88,15 @@ display_help() { disk writes. Best to let the kernel do appropriate buffering. -g Set name of the group to run with. Override the usual behaviour of using the primary group membership of the user - specified with -u and run with this GID. All files created by + specified with -u and run with this GID. Log files created by lumberjack will be owned by this group. The default is to run with the primary group that executed lumberjack, which is - usually root. + usually root. This option is only available to root. -h Display this help. -i Read input from the pipe/FIFO at , rather than stdin. - If the pipe/FIFO does not exist, it will be created. + If the pipe/FIFO does not exist, it will be created. Use '-o' + to set the ownership of the pipe/FIFO. The pipe/FIFO is created + before any user or group switching is performed. -j Maximum number of compression jobs to have active at once. Default: $MAXJOBS. Don't set this too high. -l Create a symlink named to the currently active log file. @@ -109,6 +111,11 @@ display_help() { Useful umasks are: 066 and 022. -mp Set the umask used when creating the pipe. Default: $PIPE_UMASK. Useful umasks are: 066 and 006. + -o Set the owner of the pipe/FIFO automatically created if none + already exists, and -i is used. The should be in the + format [user]:[group], where [user] or [group] is optional, but + not both. The ownership is changed before any user or group + switching is performed. This option is only available to root. -p Make all parents. Normally, all directories up to - but not including - the first directory with non-escaped %-format strings of the