File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
rootfs/etc/services.d/logrotate Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 22
33set -e # Exit immediately if a command exits with a non-zero status.
44
5+ # Run hourly.
6+ INTERVAL_IN_SECS=3600
7+
58# Make sure we appear with a proper name under `ps`.
69if [ ! -L " $0 " ]; then
710 SV_NAME=" $( basename " $( pwd) " ) "
@@ -10,17 +13,16 @@ if [ ! -L "$0" ]; then
1013fi
1114
1215log () {
13- echo " [$( basename " $0 " ) ] $* "
16+ if [ -n " ${1-} " ]; then
17+ echo " [$( basename " $0 " ) ] $* "
18+ else
19+ while read OUTPUT; do
20+ echo " [$( basename " $0 " ) ] $OUTPUT "
21+ done
22+ fi
1423}
1524
1625log " starting..."
17- while true ; do
18- s6-applyuidgid -u $USER_ID -g $GROUP_ID -G ${SUP_GROUP_IDS:- $GROUP_ID } /usr/sbin/logrotate -s /config/logrotate.status /etc/logrotate.conf
19- EXITVALUE=$?
20- if [ $EXITVALUE != 0 ]; then
21- log " exited abnormally with [$EXITVALUE ]"
22- fi
23- sleep 3600
24- done
26+ s6-applyuidgid -u $USER_ID -g $GROUP_ID -G ${SUP_GROUP_IDS:- $GROUP_ID } /usr/local/bin/watch -i " $INTERVAL_IN_SECS " /usr/sbin/logrotate -s /config/logrotate.status /etc/logrotate.conf | log
2527
2628# vim:ft=sh:ts=4:sw=4:et:sts=4
You can’t perform that action at this time.
0 commit comments