diff --git a/Dockerfile b/Dockerfile index 316922de..239ed17e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -140,6 +140,7 @@ RUN ln -fs /opt/idds/config/idds/supervisord_idds.ini /etc/supervisord.d/idds.in RUN ln -fs /opt/idds/config/idds/supervisord_httpd.ini /etc/supervisord.d/httpd.ini # RUN ln -fs /opt/idds/config/idds/supervisord_syslog-ng.ini /etc/supervisord.d/syslog-ng.ini RUN ln -fs /opt/idds/config/idds/supervisord_logrotate.ini /etc/supervisord.d/logrotate.ini +RUN ln -fs /opt/idds/config/idds/logrotate_idds /etc/logrotate.d/idds # for syslog-ng RUN mv /etc/syslog-ng/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf.back diff --git a/main/config_default/logrotate_daemon b/main/config_default/logrotate_daemon new file mode 100755 index 00000000..f13cfe02 --- /dev/null +++ b/main/config_default/logrotate_daemon @@ -0,0 +1,2 @@ +#!/bin/bash +while true; do /usr/sbin/logrotate -s /var/log/idds/logrotate.status -d /etc/logrotate.d/idds; sleep 86400; done diff --git a/main/config_default/supervisord_logrotate.ini b/main/config_default/supervisord_logrotate.ini index 0e3806c3..bde8c1d4 100644 --- a/main/config_default/supervisord_logrotate.ini +++ b/main/config_default/supervisord_logrotate.ini @@ -1,5 +1,6 @@ -[program:log_rotate] -command=/usr/sbin/logrotate -d /etc/logrotate.d/idds +[program:logrotate] +# command=/usr/sbin/logrotate -s /var/log/idds/logrotate.status -d /etc/logrotate.d/idds +command=/opt/idds/config/idds/logrotate_daemon # process_name=%(process_num)02d # user=atlpan childlogdir=/var/log/idds diff --git a/start-daemon.sh b/start-daemon.sh index 6020bd83..ff9382d1 100755 --- a/start-daemon.sh +++ b/start-daemon.sh @@ -135,7 +135,9 @@ else # cp /opt/idds/config_default/supervisord_syslog-ng.ini /opt/idds/config/idds/supervisord_syslog-ng.ini cp /opt/idds/config_default/supervisord_logrotate.ini /opt/idds/config/idds/supervisord_logrotate.ini - cp /opt/idds/config_default/logrotate_idds /etc/logrotate.d/idds + cp /opt/idds/config_default/logrotate_idds /opt/idds/config/idds/logrotate_idds + cp /opt/idds/config_default/logrotate_daemon /opt/idds/config/idds/logrotate_daemon + chmod +x /opt/idds/config/idds/logrotate_daemon fi if [ -f /etc/grid-security/hostkey.pem ]; then