EOF
}
+write_logrotate_conf() {
+ out_dir=$(pwd)"/out/*.log"
+
+ cat << EOF
+$out_dir
+{
+ rotate 5
+ size 1G
+ copytruncate
+ compress
+ notifempty
+ missingok
+ sharedscripts
+ postrotate
+ # NOTE: assuring that the absence of one of the following processes
+ # won't abort the logrotate command.
+ killall -u $USER -q -1 ceph-mon ceph-mgr ceph-mds ceph-osd ceph-fuse radosgw rbd-mirror || echo ""
+ endscript
+}
+EOF
+}
+
+init_logrotate() {
+ logrotate_conf_path=$(pwd)"/logrotate.conf"
+ logrotate_state_path=$(pwd)"/logrotate.state"
+
+ if ! test -a $logrotate_conf_path; then
+ if test -a $logrotate_state_path; then
+ rm -f $logrotate_state_path
+ fi
+ write_logrotate_conf > $logrotate_conf_path
+ fi
+}
+
start_mon() {
local MONS=""
local count=0
echo "NOTE:"
echo " Remember to restart cluster after removing $STRAY_CONF_PATH"
fi
+
+init_logrotate