Skip to content

Remove invalid configuration on error#408

Merged
cgzones merged 2 commits intologrotate:masterfrom
cgzones:void_config
Jun 30, 2021
Merged

Remove invalid configuration on error#408
cgzones merged 2 commits intologrotate:masterfrom
cgzones:void_config

Conversation

@cgzones
Copy link
Member

@cgzones cgzones commented Jun 22, 2021

After failing while parsing an invalid configuration file, like:

/some/path

remove the erroneous configuration structure from the internal list.

Else one might see:

reading config file config.tmp
error: config.tmp:1 missing '{' after log files definition
Reading state from file: state.tmp
error: error opening state file state.tmp: No such file or directory
Allocating hash table for state file, size 64 entries

Handling 1 logs

rotating pattern: (null) forced from command line (no old logs will be kept)
empty log files are rotated, old logs are removed
No logs found. Rotation not needed.

cgzones added 2 commits June 22, 2021 19:40
After failing while parsing an invalid configuration file, like:

    /some/path

remove the erroneous configuration structure from the internal list.

Else one might see:

    reading config file config.tmp
    error: config.tmp:1 missing '{' after log files definition
    Reading state from file: state.tmp
    error: error opening state file state.tmp: No such file or directory
    Allocating hash table for state file, size 64 entries

    Handling 1 logs

    rotating pattern: (null) forced from command line (no old logs will be kept)
    empty log files are rotated, old logs are removed
    No logs found. Rotation not needed.
@cgzones cgzones merged commit 81e19dd into logrotate:master Jun 30, 2021
@cgzones cgzones deleted the void_config branch June 30, 2021 17:35
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

Successfully merging this pull request may close these issues.

2 participants