diff options
Diffstat (limited to 'snap-src/bin')
-rwxr-xr-x | snap-src/bin/config | 4 | ||||
-rwxr-xr-x | snap-src/bin/mongodb-control | 28 |
2 files changed, 28 insertions, 4 deletions
diff --git a/snap-src/bin/config b/snap-src/bin/config index aba15f63..855caa32 100755 --- a/snap-src/bin/config +++ b/snap-src/bin/config @@ -104,8 +104,8 @@ DESCRIPTION_IMAGE_COMPRESS_RATIO="Image compress ratio: Allow to shrink attached DEFAULT_IMAGE_COMPRESS_RATIO="" KEY_IMAGE_COMPRESS_RATIO="image-compress-ratio" -DESCRIPTION_BIGEVENTS_PATTERN="Big events pattern: Notify always due etc regardless of notification settings. Default: due, All: received|start|due|end, Disabled: NONE" -DEFAULT_BIGEVENTS_PATTERN="" +DESCRIPTION_BIGEVENTS_PATTERN="Big events pattern: Notify always due etc regardless of notification settings. Default: NONE, All: received|start|due|end, Disabled: NONE" +DEFAULT_BIGEVENTS_PATTERN="NONE" KEY_BIGEVENTS_PATTERN="bigevents-pattern" DESCRIPTION_NOTIFY_DUE_DAYS_BEFORE_AND_AFTER="Notify due days, default 2 days before and after. 0 = due notifications disabled. Default: 2" diff --git a/snap-src/bin/mongodb-control b/snap-src/bin/mongodb-control index 28e58670..db01cffd 100755 --- a/snap-src/bin/mongodb-control +++ b/snap-src/bin/mongodb-control @@ -16,6 +16,24 @@ fi export LC_ALL=C +# When starting MongoDB, if logfile exist, delete it, because now uses syslog instead of logfile, +# because syslog usually already has log rotation. +# https://github.com/wekan/wekan-snap/issues/92 +if test -f "$SNAP_COMMON/mongodb.log"; then + rm -f "$SNAP_COMMON/mongodb.log" +fi + +# Alternative: When starting MongoDB, and using logfile, truncate log to last 1000 lines of text. +# 1) If file exists: +#if test -f "$SNAP_COMMON/mongodb.log"; then +# # 2) Copy last 1000 lines to variable loglast1000lines. +# loglast1000lines=$(tail -1000 "$SNAP_COMMON/mongodb.log") +# # 3) Copy variable to replace original MongoDB log. +# echo "$loglast1000lines" > "$SNAP_COMMON/mongodb.log" +# # 4) Set variable to be empty. +# loglast1000lines="" +#fi + if [ -z "$MONGO_URL" ]; then # start mongo deamon @@ -31,11 +49,17 @@ if [ -z "$MONGO_URL" ]; then fi echo "mongodb bind options: $BIND_OPTIONS" - mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $BIND_OPTIONS --smallfiles + ## OLD: Logging to file. + #mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $BIND_OPTIONS --smallfiles + ## NEW: Logging to syslog, that usually has already log rotation. + mongod --dbpath $SNAP_COMMON --syslog --journal $BIND_OPTIONS --smallfiles else - mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $MONGO_URL --smallfiles + ## OLD: Logging to file. + #mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $MONGO_URL --smallfiles + ## NEW: Logging to syslog, that usually has already log rotation. + mongod --dbpath $SNAP_COMMON --syslog --journal $MONGO_URL --smallfiles fi |