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

Mondoo Tmp Files Not Cleaned Up #4569

Open
benr opened this issue Aug 16, 2024 · 1 comment
Open

Mondoo Tmp Files Not Cleaned Up #4569

benr opened this issue Aug 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@benr
Copy link
Member

benr commented Aug 16, 2024

Describe the bug

Any system running for a sufficient period of time will accumulate a massive number of mondoo.tmp* files, some of which can be very large. We must be responsible and clean these up.

benr@mondoo-builder-6:/tmp$ ls -lh mondoo.tmp*
-rw------- 1 runner runner    0 Aug 16 17:12 mondoo.tmp1030408438
-rw------- 1 runner runner    0 Aug 13 16:55 mondoo.tmp1092537027
-rw------- 1 runner runner    0 Aug 13 16:55 mondoo.tmp1118105938
-rw------- 1 runner runner 7.4M Aug 15 13:16 mondoo.tmp1137938146
-rw------- 1 runner runner 202M Aug 16 18:43 mondoo.tmp1144118985
-rw------- 1 runner runner 202M Aug 16 18:07 mondoo.tmp1149317583
-rw------- 1 runner runner 7.4M Aug 16 18:43 mondoo.tmp120964499
-rw------- 1 runner runner 7.4M Aug 13 16:55 mondoo.tmp1243296810
-rw------- 1 runner runner 202M Aug 16 17:20 mondoo.tmp1317475517
-rw------- 1 runner runner 202M Aug 15 13:16 mondoo.tmp1323652601
-rw------- 1 runner runner    0 Aug 16 17:12 mondoo.tmp133777993
-rw------- 1 runner runner 7.4M Aug 12 21:14 mondoo.tmp1349160398
-rw------- 1 runner runner    0 Aug 16 14:31 mondoo.tmp1353711741
-rw------- 1 runner runner    0 Aug 15 13:16 mondoo.tmp1379380956
-rw------- 1 runner runner 7.4M Aug 14 14:34 mondoo.tmp1392019352
-rw------- 1 runner runner 7.4M Aug 16 17:12 mondoo.tmp1428357324
-rw------- 1 runner runner    0 Aug 12 21:13 mondoo.tmp1444874429
-rw------- 1 runner runner 7.4M Aug 16 17:20 mondoo.tmp1542312746
-rw------- 1 runner runner 7.4M Aug 16 17:59 mondoo.tmp1622397296
-rw------- 1 runner runner 7.4M Aug 13 09:33 mondoo.tmp1634829149
-rw------- 1 runner runner 7.4M Aug 13 09:33 mondoo.tmp1714231005
-rw------- 1 runner runner 202M Aug 13 16:55 mondoo.tmp1717838533
-rw------- 1 runner runner    0 Aug 14 11:53 mondoo.tmp1742924482
-rw------- 1 runner runner 202M Aug 16 18:07 mondoo.tmp176790419
-rw------- 1 runner runner    0 Aug 16 18:07 mondoo.tmp1775312403
-rw------- 1 runner runner 202M Aug 13 10:42 mondoo.tmp1796838803
-rw------- 1 runner runner 202M Aug 16 17:20 mondoo.tmp1800404255
-rw------- 1 runner runner 7.4M Aug 16 17:12 mondoo.tmp1827850624
-rw------- 1 runner runner 202M Aug 13 09:33 mondoo.tmp1953522775
-rw------- 1 runner runner 202M Aug 16 17:59 mondoo.tmp1985350913
-rw------- 1 runner runner    0 Aug 14 11:53 mondoo.tmp208122400
-rw------- 1 runner runner    0 Aug 16 17:19 mondoo.tmp2082134095
-rw------- 1 runner runner    0 Aug 14 11:53 mondoo.tmp2099457278
-rw------- 1 runner runner 7.4M Aug 15 13:16 mondoo.tmp2146887951
-rw------- 1 runner runner 202M Aug 14 11:53 mondoo.tmp2207212472
-rw------- 1 runner runner    0 Aug 12 21:13 mondoo.tmp223515222
-rw------- 1 runner runner 7.4M Aug 16 18:07 mondoo.tmp2248815102
-rw------- 1 runner runner    0 Aug 16 18:43 mondoo.tmp2260736725
-rw------- 1 runner runner    0 Aug 12 21:13 mondoo.tmp2265062429
-rw------- 1 runner runner 7.4M Aug 12 21:14 mondoo.tmp2283280768
-rw------- 1 runner runner 202M Aug 14 11:53 mondoo.tmp2293115656
-rw------- 1 runner runner    0 Aug 14 14:34 mondoo.tmp2400969780
-rw------- 1 runner runner 202M Aug 13 10:42 mondoo.tmp2418922629
-rw------- 1 runner runner 202M Aug 16 18:43 mondoo.tmp2455327338
...

Additionally, they should be named "cnquery" or "cnspec", not "mondoo". From the perspective of an unaware administrator there is no clear connection on the system between the cnspec process running and the /tmp/mondoo.tmp* files it's creating.

@chris-rock chris-rock added the enhancement New feature or request label Aug 21, 2024
@chris-rock
Copy link
Member

I see a few things we need to figure out:

  1. Why are the files not cleaned. Normally we clean files, so we need to find the case where this is happening
  2. Separate problem is naming, lets extract the product name https://github.com/mondoohq/cnquery/blob/main/cnquery.go#L142-L144 and https://github.com/mondoohq/cnspec/blob/main/cnspec.go#L95-L98 so that we can a function to get the string.

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

No branches or pull requests

2 participants