Skip to content

Commit

Permalink
Merge pull request #176 from HSF/dev
Browse files Browse the repository at this point in the history
fix log rotation
  • Loading branch information
wguanicedew authored Jun 7, 2023
2 parents 01620bd + 1b579ce commit 9088e99
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions main/config_default/logrotate_daemon
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions main/config_default/supervisord_logrotate.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion start-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9088e99

Please sign in to comment.