### Install and Initialize Etckeeper with Git Source: https://etckeeper.branchable.com/forum/index.atom Steps to install etckeeper, initialize a git repository in /etc, and set up a remote origin. This is a common setup for managing /etc with git. ```bash apt install etckeeper cd /etc/ git status git diff git commit -m "initial commit" git gc git remote add origin http://git.server/user/server_etc.git ``` ```bash git branch -m host-one git push --set-upstream origin host-one ``` -------------------------------- ### Example Process Tree with apt-get Install Source: https://etckeeper.branchable.com/forum/the_default_commit_message_has_the_wrong_process_name This process tree demonstrates the execution flow when etckeeper's post-install script is invoked during an 'apt-get install' operation on Debian. It highlights the involvement of 'sh -c' and the etckeeper scripts within the apt-get process. ```text 400678 pts/18 S+ 0:01 | \_ apt-get remove --purge docbook-xsl libxml2-utils 400894 pts/18 S+ 0:00 | \_ apt-get remove --purge docbook-xsl libxml2-utils 400895 pts/18 S+ 0:00 | \_ sh -c -- if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi 400896 pts/18 S+ 0:00 | \_ /bin/sh /usr/bin/etckeeper post-install 400901 pts/18 S+ 0:00 | \_ /bin/sh /etc/etckeeper/post-install.d/50vcs-commit ``` -------------------------------- ### Example of apt-get install command Source: https://etckeeper.branchable.com/forum/index.atom This command installs the apt-transport-https package, which is required for APT to handle packages over HTTPS connections. ```bash apt-get install apt-transport-https ``` -------------------------------- ### Install etckeeper Source: https://etckeeper.branchable.com/README Installs etckeeper using apt-get. This is the first step before using etckeeper. ```bash apt-get install etckeeper ``` -------------------------------- ### Build and Install etckeeper on LEDE Source: https://etckeeper.branchable.com/todo/Porting_to_LEDE___40__OpenWRT__41___opkg/comments.rss This snippet shows the output of attempting to build and install etckeeper on a LEDE system. It highlights missing dependencies like perl and bzrlib, as well as errors during the make install process. ```bash root@LEDE:~/etckeeper.branchable.com# make sed -i~ "s/Version:.<em>/Version: $(perl -e '$_=&lt;&gt;;m/((.<em>?)(-.<em>)?)/;print $1;'&lt;debian/changelog)/" etckeeper.spec /bin/sh: perl: not found rm -f etckeeper.spec~ sed -i~ "s/Version:.</em>/Version: $(perl -e '$<em>=&lt;&gt;;m/((.<em>?)(-.</em>)?)/;print $1;' &lt;debian/changelog)\"/" etckeeper /bin/sh: perl: not found rm -f etckeeper~ python ./etckeeper-bzr/<strong>init</strong>.py build || echo "<strong> bzr support not built" Traceback (most recent call last): File "./etckeeper-bzr/<strong>init</strong>.py", line 6, in from bzrlib.errors import BzrError ImportError: No module named bzrlib.errors </strong> bzr support not built python ./etckeeper-dnf/etckeeper.py build || echo "<strong> DNF support not built" Traceback (most recent call last): File "./etckeeper-dnf/etckeeper.py", line 10, in from dnfpluginscore import logger ImportError: No module named dnfpluginscore </strong> DNF support not built root@LEDE:~/etckeeper.branchable.com# root@LEDE:~/etckeeper.branchable.com# root@LEDE:~/etckeeper.branchable.com# make install sed -i~ "s/Version:.*/Version: $(perl -e '$</em>=&lt;&gt;;m/((.<em>?)(-.</em>)?)/;print $1;' &lt;debian/changelog)\"/" etckeeper /bin/sh: perl: not found rm -f etckeeper~ mkdir -p /etc/etckeeper/ /var/cache/etckeeper/ cp -R <em>.d /etc/etckeeper/ install daily /etc/etckeeper/daily make: install: Command not found make: </em>** [Makefile:29: install] Error 127 root@LEDE:~/etckeeper.branchable.com# ``` -------------------------------- ### Apt-get Process Tree Example Source: https://etckeeper.branchable.com/recentchanges Process tree structure observed when running etckeeper post-install via apt-get. ```text 400678 pts/18 S+ 0:01 | \_ apt-get remove --purge docbook-xsl libxml2-utils 400894 pts/18 S+ 0:00 | \_ apt-get remove --purge docbook-xsl libxml2-utils 400895 pts/18 S+ 0:00 | \_ sh -c -- if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi 400896 pts/18 S+ 0:00 | \_ /bin/sh /usr/bin/etckeeper post-install 400901 pts/18 S+ 0:00 | \_ /bin/sh /etc/etckeeper/post-install.d/50vcs-commit ``` -------------------------------- ### Process tree examples Source: https://etckeeper.branchable.com/ikiwiki.cgi?do=goto&page=forum%2Fthe_default_commit_message_has_the_wrong_process_name Displays various process tree structures observed during etckeeper post-install execution for different environments. ```text 397908 pts/16 Ss 0:00 | \_ sudo -H /bin/bash 397909 pts/16 S 0:00 | \_ /bin/bash 399115 pts/16 S+ 0:00 | \_ /bin/sh /usr/bin/etckeeper post-install 399121 pts/16 S+ 0:00 | \_ /bin/sh /etc/etckeeper/post-install.d/50vcs-commit ``` ```text 400678 pts/18 S+ 0:01 | \_ apt-get remove --purge docbook-xsl libxml2-utils 400894 pts/18 S+ 0:00 | \_ apt-get remove --purge docbook-xsl libxml2-utils 400895 pts/18 S+ 0:00 | \_ sh -c -- if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi 400896 pts/18 S+ 0:00 | \_ /bin/sh /usr/bin/etckeeper post-install 400901 pts/18 S+ 0:00 | \_ /bin/sh /etc/etckeeper/post-install.d/50vcs-commit ``` ```text 131379 pts/2 SN 0:00 \_ /usr/bin/bash 131967 pts/2 SN+ 0:00 \_ pacman -R mc 132102 pts/2 SN+ 0:00 \_ /bin/sh /usr/bin/etckeeper post-install 132106 pts/2 SN+ 0:00 \_ /bin/sh /etc/etckeeper/post-install.d/50vcs-commit ``` -------------------------------- ### Install Package with apt Source: https://etckeeper.branchable.com/forum/index.atom Installs a package using apt. etckeeper might warn about uncommitted changes if a transaction is still open. ```bash apt-get install sublime-text ``` -------------------------------- ### Example touch command for setting mtime Source: https://etckeeper.branchable.com/todo/include_mtime_into_metadata/comments.rss This command demonstrates how to set the modification time of a file. It's used as an example for specifying a time to 'touch' a file when considering mtime storage. ```bash maybe touch -d '1970-01-01 00:00Z' foo ``` -------------------------------- ### Manual etckeeper post-install process tree Source: https://etckeeper.branchable.com/forum/the_default_commit_message_has_the_wrong_process_name/comments.rss Example of a process tree observed when running etckeeper post-install manually. ```text 397908 pts/16 Ss 0:00 | \_ sudo -H /bin/bash 397909 pts/16 S 0:00 | \_ /bin/bash 399115 pts/16 S+ 0:00 | \_ /bin/sh /usr/bin/etckeeper post-install 399121 pts/16 S+ 0:00 | \_ /bin/sh /etc/etckeeper/post-install.d/50vcs-commit ``` -------------------------------- ### Execute etckeeper build and install commands Source: https://etckeeper.branchable.com/todo/Porting_to_LEDE___40__OpenWRT__41___opkg Attempt to build and install etckeeper on a LEDE system, showing failures due to missing Perl and Python interpreters. ```bash make install root@LEDE:~/etckeeper.branchable.com# make sed -i~ "s/Version:._/Version: $(perl -e '$_= <>;m/((._?)(-._)?)/;print $1;' ;m/((._?)(-._)?)/;print $1;' ;m/((._?)(-._)?)/;print $1;'