Hi all, i set up a simple Kamailio SIP server with the latest stable versione. Than, by following the documntation, i tried to set up a file log instead of the standard syslog log, so i changed the syslog.conf by adding this lines:
# don't log messages with LOG_LOCAL0 in /var/log/syslog anymore *.*;auth,authpriv.none,local0.none -/var/log/syslog
# # log messages with LOG_LOCAL0 in /var/log/kamailio.log local0.* -/var/log/kamailio.log
Then, i created a kamailio file in /etc/logrotate.d with this content to manage the log rotation:
/var/log/kamailio.log { su root root daily rotate 7 compress delaycompress missingok notifempty create 0640 syslog adm postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true endscript }
I found all these information in https://www.kamailio.org/wikidocs/tutorials/3.2.x/syslog/ Unfortunatly, in my Ubuntu 22.04 server there isn't a syslogd.pid file in that path so the logrotation doesn't work. Can anyone help me to understand the problem? Thank you so much in advance Christian
Hello,
try to use:
postrotate /usr/lib/rsyslog/rsyslog-rotate 2> /dev/null || true Endscript
Cheers,
Henning
-----Original Message----- From: christian.marinelli--- via sr-users sr-users@lists.kamailio.org Sent: Dienstag, 16. April 2024 18:27 To: sr-users@lists.kamailio.org Cc: christian.marinelli@hotmail.it Subject: [SR-Users] Problem with logrotate in Ubuntu 22.04!
Hi all, i set up a simple Kamailio SIP server with the latest stable versione. Than, by following the documntation, i tried to set up a file log instead of the standard syslog log, so i changed the syslog.conf by adding this lines:
# don't log messages with LOG_LOCAL0 in /var/log/syslog anymore *.*;auth,authpriv.none,local0.none -/var/log/syslog # # log messages with LOG_LOCAL0 in /var/log/kamailio.log local0.* -/var/log/kamailio.log
Then, i created a kamailio file in /etc/logrotate.d with this content to manage the log rotation:
/var/log/kamailio.log { su root root daily rotate 7 compress delaycompress missingok notifempty create 0640 syslog adm postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true endscript }
I found all these information in https://www.kamailio.org/wikidocs/tutorials/3.2.x/syslog/ Unfortunatly, in my Ubuntu 22.04 server there isn't a syslogd.pid file in that path so the logrotation doesn't work. Can anyone help me to understand the problem? Thank you so much in advance Christian __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hi, yes, in the next days i assumed that the first logrotate configuration was wrong, and i need to use this command on the postrotate statement. Thank you so much for you support Christian