Skip to content

Instantly share code, notes, and snippets.

@tonyskapunk
Created February 2, 2019 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyskapunk/3b66e3693f3c615040a8d7586d8d785b to your computer and use it in GitHub Desktop.
Save tonyskapunk/3b66e3693f3c615040a8d7586d8d785b to your computer and use it in GitHub Desktop.
kthresher defaults

Reasons why kthresher does not do "anything" by default.

  • Main purpose is to run it through a cronjob to remove kernels/headers (cadidates for auto-removal)
  • When a configuration is put in place the behavior of kthresher is modified so it achieves what's defined in the config

Examples of the change of behavior running kthresher

  • Without any additional config, will print the help to understand what it does
  • With a config in place will perform that action, e.g. purge kernels

I can easily set a default action, for instance print the available kernels, if any, like what -s does.

Here I implemented that: https://github.com/tonyskapunk/kthresher/commit/50b67c2b0caa1ca117f8bf3d4b87d5fd39b753d0

But found an issue to it. This would work only without a config in place, once a config defining the purge, kthresher will attempt to do purge kernels/headers. There wouldn't be a way to print the available kernels/headers like running -s, unless I add some logic to not fully remove that -s and only implement -s as the default action when nothing else is specified through the configuration or command line.


  • If we provide headers by default in the config file, there is no way to disable headers through command line. The only way to not include headers is
    1. Editing the default config to remove the headers.
    2. Create another config to override its value.
    3. Implement a --no-headers flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment