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

Clean up temp files #8157

Merged
merged 2 commits into from Jan 13, 2021
Merged

Clean up temp files #8157

merged 2 commits into from Jan 13, 2021

Conversation

Al2Klimov
Copy link
Member

fixes #5124

@Al2Klimov Al2Klimov added the bug Something isn't working label Aug 7, 2020
@Al2Klimov Al2Klimov added this to the 2.13.0 milestone Aug 7, 2020
@Al2Klimov Al2Klimov added this to To review in v2.13.0 merge window via automation Aug 7, 2020
@Al2Klimov
Copy link
Member Author

➜  icinga2 git:(bugfix/temporary-files-5124) touch prefix/var/lib/icinga2/icinga2.state.1
➜  icinga2 git:(bugfix/temporary-files-5124) touch prefix/var/lib/icinga2/icinga2.state.2
➜  icinga2 git:(bugfix/temporary-files-5124) touch prefix/var/lib/icinga2/icinga2.state.3
➜  icinga2 git:(bugfix/temporary-files-5124) ls prefix/var/lib/icinga2
api                  certificate-requests certs                icinga2.state.1      icinga2.state.2      icinga2.state.3
➜  icinga2 git:(bugfix/temporary-files-5124) prefix/sbin/icinga2 daemon
[2020-08-07 14:04:53 +0200] information/cli: Icinga application loader (version: v2.12.0-1-g294737c51)
[2020-08-07 14:04:53 +0200] information/cli: Loading configuration file(s).
[2020-08-07 14:04:53 +0200] information/ConfigItem: Committing config item(s).
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 235 CheckCommands.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 Endpoint.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 Host.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 2 HostGroups.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 12 Notifications.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 2 NotificationCommands.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 3 ServiceGroups.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 11 Services.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 3 Zones.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 3 TimePeriods.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 User.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 UserGroup.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2020-08-07 14:04:54 +0200] information/ScriptGlobal: Dumping variables to file '/Users/aklimov/NET/WS/icinga2/prefix/var/cache/icinga2/icinga2.vars'
[2020-08-07 14:04:54 +0200] information/ConfigItem: Triggering Start signal for config items
[2020-08-07 14:04:54 +0200] information/FileLogger: 'main-log' started.
[2020-08-07 14:04:54 +0200] information/NotificationComponent: 'notification' started.
[2020-08-07 14:04:54 +0200] information/CheckerComponent: 'checker' started.
[2020-08-07 14:04:54 +0200] information/ConfigItem: Activated all objects.
[2020-08-07 14:04:54 +0200] warning/PluginCheckTask: Check command for object 'alexanders-mbp.int.netways.de' (PID: 46929, arguments: '/Users/aklimov/NET/WS/icinga2/prefix/usr/lib/nagios/plugins/check_ping' '-H' '127.0.0.1' '-c' '5000,100%' '-w' '3000,80%') terminated with exit code 128, output: execvpe(/Users/aklimov/NET/WS/icinga2/prefix/usr/lib/nagios/plugins/check_ping) failed: No such file or directory

^C[2020-08-07 14:04:55 +0200] information/Application: Received request to shut down.
[2020-08-07 14:04:56 +0200] information/Application: Shutting down...
[2020-08-07 14:04:56 +0200] information/CheckerComponent: 'checker' stopped.
[2020-08-07 14:04:56 +0200] information/NotificationComponent: 'notification' stopped.
[2020-08-07 14:04:56 +0200] information/ConfigObject: Dumping program state to file '/Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/icinga2.state'
[2020-08-07 14:04:56 +0200] information/IcingaApplication: Icinga has shut down.
➜  icinga2 git:(bugfix/temporary-files-5124) ls prefix/var/lib/icinga2
api                      certificate-requests     certs                    icinga2.state            modified-attributes.conf
➜  icinga2 git:(bugfix/temporary-files-5124)

Copy link
Contributor

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments apply to both locations.

lib/base/configobject.cpp Outdated Show resolved Hide resolved
lib/base/configobject.cpp Outdated Show resolved Hide resolved
v2.13.0 merge window automation moved this from To review to Changes requested Jan 4, 2021
Copy link
Contributor

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the log tag, this LGTM.

try {
Utility::Glob(path + ".tmp.*", &Utility::Remove, GlobFile);
} catch (const std::exception& ex) {
Log(LogWarning, "ConfigObject") << DiagnosticInformation(ex);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log tag should be "IcingaApplication".

v2.13.0 merge window automation moved this from Changes requested to Approved Jan 13, 2021
@julianbrost julianbrost merged commit f12666c into master Jan 13, 2021
v2.13.0 merge window automation moved this from Approved to Merged Jan 13, 2021
@icinga-probot icinga-probot bot deleted the bugfix/temporary-files-5124 branch January 13, 2021 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Netstring files not fully not written on reload, many temporary files (icinga2.state, etc.)
2 participants