-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added newsyslog rules for FreeBSD #1724
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1724 +/- ##
========================================
Coverage 68.66% 68.66%
========================================
Files 82 82
Lines 11737 11737
Branches 1645 1645
========================================
Hits 8059 8059
Misses 3326 3326
Partials 352 352 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @narrieta can you take a look?
@@ -0,0 +1 @@ | |||
/var/log/waagent.log 644 7 * @T00 J /var/run/waagent.pid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of questions:
-
If I'm reading the documentation correctly, by adding waagent.pid, the agent would be sent a SIGHUP on rotation... how does the agent handle this signal?
-
From the documentation it was not clear to me how optional fields are specified. I see that you skipped owner (2nd field). Are the TABs between "waagent.log" and "644" significant? I also see a TAB between "*" and "@t00"
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, man page of newsyslog.conf reads as: "Each line has five mandatory fields and four optional fields, separated with whitespace". Any number of TABs or SPACEs count as whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
SIGHUP is not needed as FileAppender.write in azurelinuxagent/common/logger.py closes the logfile after each write. I removed the pid file from the newsyslog config.
BR, Felix
Description
waagent logs to /var/log/waagent.log. On FreeBSD, this logfile happens to grow. In contrast to Linux, there is no logrotate. Instead, every FreeBSD installation comes with newsyslog, which is similar to logrotate. The configuration of newsyslog is modular, i.e. the main configuration file /etc/newsyslog.conf also reads every file in the directory /etc/newsyslog.conf.d. My patch places a newsyslog config file for waagent in /etc/newsyslog.conf.d, which rotates the log file every midnight, and keeps up to 7 historical, compressed logfiles. setup.py was modified to copy over this configuration file on FreeBSD.
PR information
Quality of Code and Contribution Guidelines
This change is