Skip to content

Commit

Permalink
have cron rotation be a no-op if internal rotation is in args
Browse files Browse the repository at this point in the history
  • Loading branch information
djnym committed Jun 30, 2017
1 parent 880ed3e commit f1b8984
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions etc/rc.d/init.d/lwes-journaller
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pidfile=/var/lock/lwes-journaller
gotpidfile=
gotport=
nodaemonize=
internalrotation=

# some options might be specified which are normally controlled
# by this script, so when we encounter those keep track of the
Expand All @@ -43,10 +44,6 @@ process_options() {
gotport=1
shift
;;
-p=?*)
gotport=1
shift
;;
--pid-file)
pidfile=$2
gotpidfile=1
Expand All @@ -61,6 +58,14 @@ process_options() {
nodaemonize=1
shift
;;
--journal-rotate-interval|-i)
internalrotation=1
shift
;;
--journal-rotate-interval=?*)
internalrotation=1
shift 2
;;
*)
shift
;;
Expand Down Expand Up @@ -131,10 +136,12 @@ gracefulstop() {

rotate() {
check_config
echo -n $"Causing $prog to rotate journals: "
killproc -p ${pidfile} $prog -HUP
RETVAL=$?
echo
if [ ! $internalrotation ] ; then
echo -n $"Causing $prog to rotate journals: "
killproc -p ${pidfile} $prog -HUP
RETVAL=$?
echo
fi
}

rotatelogs() {
Expand Down

0 comments on commit f1b8984

Please sign in to comment.