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

Download package diagnostics #106

Closed
stylesuxx opened this issue Aug 21, 2022 · 5 comments
Closed

Download package diagnostics #106

stylesuxx opened this issue Aug 21, 2022 · 5 comments
Assignees

Comments

@stylesuxx
Copy link
Collaborator

Every installed package should have an additional Menu "More".

The first option being available there is a "Download diagnostics" button which retrieves the packages logs and diagnostic files from a pre-determined location.

Further each package should be allowed to override the command in which the diagnostics/logs are being fetched in order to add more data.

@j005u
Copy link
Contributor

j005u commented Aug 21, 2022

So, to be a bit more specific, the default would be to zip up and provide the user with:

  • /opt/etc/package-config/$packageName/*
  • /blackbox/package-logs/$packageName/*

The former relates to user settings for the package and #7 as well as https://github.com/fpv-wtf/wtfos-package-config

The latter can populated by the package dinit unit's logfile property with a combination of the entware logrotate package to keep things sane. The package may optionally use package-config to determine their loglevel.

Additionally, packages could specify further things to include either by

  • Providing an arbitary command to create the archive
    • In some package metadata somewhere
    • As an addition script in dinit control
  • Providing a list of glob patterns of files to include and commands to run and store the output of (unrd, getprop, what have you).

I don't think we should necessarily provide all interfaces, but I'm not sure which is the better approach.

Looking for feedback from @funneld and @bri3d as well.

stylesuxx added a commit that referenced this issue Aug 22, 2022
…the package list. For now only downloads hardcoded wtfos.log #106
@stylesuxx
Copy link
Collaborator Author

Having implemented part of the functionality now, I am not super happy about an optional arbitrary command per package to create the archive. I would much rather prefer an optional script to be called before the archive is generated:

I check the package for a preDownloadDiagnosticsHook.sh script, run that which dumps everything it needs to dump into the log folders and then the configurator proceeds to archive everything up.

In step 1 I would suggest we only pack up the configs and logs dirs and see if there is need for any custom stuff to be added before downloading the archive.

@stylesuxx stylesuxx self-assigned this Aug 22, 2022
@j005u
Copy link
Contributor

j005u commented Aug 22, 2022

That makes sense, in hindsight the custom streaming archive command is a bit obtuse.

So, where do we stick preDownloadDiagnosticsHook.sh, is it another one-off folder in /opt/etc? Is it stored next to the package config stuff? Could we add it as a new script in the packages control section?

Also, considering we want to stream the archive out and not use disk space (because we may not have it), could the executable optionally be able to return a newline delimited list of additional paths rather than be forced to copy into the logs folder?

@stylesuxx
Copy link
Collaborator Author

Yes, I would even prefer a script that return paths.
Not sure where the file should live. I think it would make the most sense to have it next to the package config stuff.

@stylesuxx
Copy link
Collaborator Author

Alright, so this is technically implemented in #111, but ultimately there is no need for this - closed.

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

No branches or pull requests

2 participants