Skip to content
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

Use of wildcards in logrotate causing duplication errors to be thrown #748

Closed
emichellecarter opened this issue Aug 11, 2023 · 3 comments
Closed

Comments

@emichellecarter
Copy link

When dsc is installed on the same instance as omi, the logrotate throws duplication errors due to the use of wildcards in the logrotate.conf file.

omi:2 duplicate log entry for /var/opt/omi/log/dscdetailed.log
found error in file omi, skipping

/etc/opt/omi/conf/omilogrotate.conf

/var/opt/omi/log/*.log /var/opt/omi/log/*.trc 
{
    # keep 5 worth of backlogs
    rotate 5

    # If the log file is missing, go on to the next one
    # without issuing an error message.
    missingok

    # Do not rotate the log if it is empty,
    # this overrides the ifempty option.
    notifempty

    # Old versions of log files are compressed with gzip by default.
    compress

    # Log files are rotated only if they grow bigger then 100M.
    size 100M

    # Truncate the original log file in place after creating a copy,
    # instead of moving the old log file and optionally creating a new one.
    copytruncate
}

/opt/microsoft/dsc/etc/logrotate.conf

/var/opt/omi/log/*.log {
	rotate 5
	sharedscripts
	weekly
	compress
	postrotate
		/opt/omi/bin/service_control restart
	endscript
}
/var/opt/omi/log/dscdetailed.log {
	rotate 5
	sharedscripts
	size 50M
	compress
}
@JumpingYang001
Copy link
Contributor

JumpingYang001 commented Aug 18, 2023

@mcarter106 I think you should file it for dsc team or dsc repo.

@JumpingYang001
Copy link
Contributor

@mcarter106 DSC got deprecated this September.

@JumpingYang001
Copy link
Contributor

@mcarter106 BTW, are you using omsagent or dsc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants