etckeeper | special support to handle changes | Command Line Interface library

 by   wertarbyte Python Version: Current License: No License

kandi X-RAY | etckeeper Summary

kandi X-RAY | etckeeper Summary

etckeeper is a Python library typically used in Utilities, Command Line Interface applications. etckeeper has no vulnerabilities and it has low support. However etckeeper has 1 bugs and it build file is not available. You can download it from GitHub.

etckeeper has special support to handle changes to /etc caused by installing and upgrading packages. Before apt installs packages, etckeeper pre-install will check that /etc contains no uncommitted changes. After apt installs packages, etckeeper post-install will add any new interesting files to the repository, and commit the changes. You can also run etckeeper commit by hand to commit changes. There is also a cron job, that will use etckeeper to automatically commit any changes to /etc each day.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              etckeeper has a low active ecosystem.
              It has 39 star(s) with 4 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 2 open issues and 0 have been closed. On average issues are closed in 2249 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of etckeeper is current.

            kandi-Quality Quality

              OutlinedDot
              etckeeper has 1 bugs (1 blocker, 0 critical, 0 major, 0 minor) and 0 code smells.

            kandi-Security Security

              etckeeper has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              etckeeper code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              etckeeper does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              etckeeper releases are not available. You will need to build from source code and install.
              etckeeper has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              etckeeper saves you 14 person hours of effort in developing the same functionality from scratch.
              It has 41 lines of code, 3 functions and 2 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed etckeeper and discovered the below as its top functions. This is intended to give you an instant insight into etckeeper implemented functionality, and help decide if they suit your requirements.
            • Run the pre - commit hook .
            • Pre - install pre - install .
            • Post - install .
            Get all kandi verified functions for this library.

            etckeeper Key Features

            No Key Features are available at this moment for etckeeper.

            etckeeper Examples and Code Snippets

            No Code Snippets are available at this moment for etckeeper.

            Community Discussions

            QUESTION

            Versioning linux folder with symlinks and them content
            Asked 2019-Sep-26 at 08:25

            My use-case is versioning application changes on server because sometimes I need to rollback previous version before update, or before configuration changes.

            This is my list of content:

            ...

            ANSWER

            Answered 2019-Sep-26 at 08:25

            Solution was easy & clean, i hope :)

            Source https://stackoverflow.com/questions/58006937

            QUESTION

            How do I use my personal git config when committing as root?
            Asked 2019-Jun-11 at 09:11

            I use etckeeper for revision control of my /etc directory.

            Due to the owership of the files under /etc, I need to run git as root.

            How can I do this and still easily have access to all my beloved git aliases and other config?

            ...

            ANSWER

            Answered 2019-Jun-11 at 09:11

            git -c include.path= will include the configuration in .

            To automatically pull in my non-root user's config files, I use the bash alias:

            Source https://stackoverflow.com/questions/54842380

            QUESTION

            Where does the python logging module write to, inside an Ansible module?
            Asked 2019-Jun-07 at 10:43

            When I run the ansible dnf module, the messages dnf writes through the logging module do not appear to go anywhere. Why does this happen?

            I have a call chain something like:

            ansible (python3) -> ansible dnf module -> import dnf ... -> dnf plugin etckeeper-dnf

            The current version of etckeeper-dnf goes on to run etckeeper, using os.system(). So it writes to stdout and confuses ansible. I assume this is an error in etckeeper-dnf. I am fairly confident that ansible is allowed to import dnf etc. I came across another fix for a dnf plugin that says the dnf cli objects are not necessarily available, which sounds like a similar scenario.

            It seems reasonable for Ansible to want to be able to control stdout/stderr, and not have them interfered with by library code.

            So I have patched etckeeper-dnf and I am effectively piping it's stdout+stderr to the python logging module. This does exactly what I wanted. It fixes Ansible. And the dnf command still shows all the etckeeper messages. (They are also now copied to /var/log/dnf.log).

            But now I have a reading comprehension problem.

            When I run the ansible dnf module, the messages dnf writes through the logging module, including from etckeeper-dnf, do not appear to go anywhere.

            That's not my change, not my fault, and it's not something I need. I even tested what would happen if etckeeper fails: etckeeper-dnf just continues, so Ansible wouldn't show any warnings about it anyway (unless I deliberately broke Ansible).

            But I can't help but feel uncomfortable about the idea that any warning messages are going to be lost.

            I made sure to test using dnfpluginscore.logger.error(), as well as .info(), but I don't see the messages in either case.

            The default configuration of the logging module is to write to stderr. The dnf module does not do anything to configure it, unless you use dnf.cli.BaseCli. The Ansible module dnf.py does not use anything from dnf.cli, and does not do anything with logging. The base class AnsibleModule does not use python logging either; it has its own independent .log() method.

            So why do the messages written with .error() not appear on the Ansible module output pipe, and break Ansible again?

            • ansible-2.7.10-1.fc29.noarch
            • dnf-4.2.2-2.fc29.noarch
            • python3-3.7.3-1.fc29.x86_64
            ...

            ANSWER

            Answered 2019-Jun-07 at 10:43

            The original etckeeper-dnf broke Ansible because it wrote to stdout. Whereas we determined that the python logging module writes to stderr.

            If you look at the output in the link, Ansible separates module_stdout and module_stderr. Usually it just ignores module_stderr; it only shows it in case of MODULE FAILURE. (Although some other modules do not always separate stdout/stderr, e.g. the Ansible script module).

            So I still think the proposed change in etckeeper-dnf is reasonable. And regardless of how deliberately the Ansible dnf module was designed this way, it seems fairly reasonable to rely on this specific behaviour. The changed code is unlikely to be broken by future changes in the Ansible dnf module.

            I would note that when you hit a MODULE FAILURE, module_stderr only shows dnf's error messages. You do not see any messages from loglevel INFO or below, i.e. dnf's usual non-error, non-interactive output.

            (If etckeeper failures were treated as fatal when using etckeeper-dnf, then it might not be a great idea to log all the etckeeper output using .info(). Ansible would miss the original error messages from etckeeper (and the error messages would not be logged anywhere else).

            However, I tested the system after hacking etckeeper to return EXIT_FAILURE. IIRC, dnf continued regardless of any etckeeper failure. The overall effect is that Ansible will not give you any information about the failure to run etckeeper, regardless of how I log errors. And in general, treating stdout and stderr messages separately is more complex and does weird things to the order of messages. So I followed the K.I.S.S. principle :-).

            Or to put it more generally:

            As per default, logging messages written at loglevel INFO and below will go nowhere. Messages at loglevel WARNING and above will go to stderr. They will not interfere with normal Ansible module operation. In normal Ansible module operation, even these messages will not go anywhere.

            If there is a MODULE FAILURE - i.e. the module crashes or does not generate JSON output that Ansible can parse as expected - Ansible will show module_stderr, which includes logging messages at or above loglevel WARNING only.

            Source https://stackoverflow.com/questions/55817067

            QUESTION

            Newly added jobs not running in cron.daily
            Asked 2017-Apr-26 at 22:01

            I'm trying to add a daily cron job to backup a database. I'm able to do it manually by running sh /path/to/file/backup.sh but when I place the file in the cron.daily directory, it doesn't run daily. To try and diagnose it, I created a test file in cron.daily called test just to see if it would run. When I ran run-parts --test /etc/cron.daily, I got the output

            /etc/cron.daily/apache2 /etc/cron.daily/apt /etc/cron.daily/bsdmainutils /etc/cron.daily/dpkg /etc/cron.daily/etckeeper /etc/cron.daily/logrotate, etc.

            So then I tried copying the content of logrotate to a new file, atest, then ran run-parts again but with the same results.

            atest:

            ...

            ANSWER

            Answered 2017-Apr-26 at 22:01

            There are a couple of things that can keep files within your /etc/cron* directories from running (e.g. /etc/cron.daily):

            1. Permissions. Make sure the permissions of the files are 0644.

            2. The filename must meet certain conditions. From the documentation: "...they must be entirely made up of letters, digits and can only contain the special signs, underscores ('_') and hyphens ('-'). Any file that does not conform to these requirements will not be executed by run-parts.

            Source https://stackoverflow.com/questions/43645045

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install etckeeper

            You can download it from GitHub.
            You can use etckeeper like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/wertarbyte/etckeeper.git

          • CLI

            gh repo clone wertarbyte/etckeeper

          • sshUrl

            git@github.com:wertarbyte/etckeeper.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Command Line Interface Libraries

            ohmyzsh

            by ohmyzsh

            terminal

            by microsoft

            thefuck

            by nvbn

            fzf

            by junegunn

            hyper

            by vercel

            Try Top Libraries by wertarbyte

            autorandr

            by wertarbyteShell

            triggerhappy

            by wertarbyteC

            tartarus

            by wertarbyteShell

            funkenschlag

            by wertarbyteC