#680197 etckeeper: Help track changes in /usr/share/myapp dir

Package:
etckeeper
Source:
etckeeper
Submitter:
Olivier Berger
Date:
2021-10-06 17:54:03 UTC
Severity:
wishlist
Tags:
#680197#5
Date:
2012-07-04 12:39:15 UTC
From:
To:
Hi.

Sometimes, some local installations of (web) apps in /usr/share need some patching that would be erased at next upgrade.

I think etckeeper could be used (with the -d option) to manage such dirs, at least manually.

What would be great is to be able to have the APT hooks able to manage such dirs (that could be listed in etckeeper.conf) too.

Hope this helps.

Best regards,

#680197#10
Date:
2015-01-09 23:13:57 UTC
From:
To:
Control: tags -1 upstream wontfix

https://etckeeper.branchable.com/todo/track_multiple_directories/

It seems like a pandora's box to me: how would you configure which
directories to track?

Besides, /usr is designed to be readonly, if you're patching files there
without building debian packages, you are doing something wrong and
etckeeper is unlikely to help you.

You are free to get inspiration from etckeeper as to how to implement
your own APT hooks, of course. :)

A.

#680197#19
Date:
2021-10-06 17:51:32 UTC
From:
To:
I thought that my system's configuration was in /etc/ and safely handled
with etckeeper until I added some systemd unit files, which truly live in
/lib/systemd and I want to make it easy to follow changes there.

Two changes, one to enable daily to run with any `-d /path/to` and one to
add /lib/systemd to the service file in /lib/systemd ... which might be
wrong for some users and so is commented out with adjacent instructions to
enable.

versus current HEAD 9b5c5b1ff500a8a3770e4b77535df8840633faf8 I have:

diff --git a/daily b/daily
index f98c6ad..9549ee0 100755
--- a/daily
+++ b/daily
@@ -11,7 +11,7 @@ if [ -x /usr/bin/etckeeper ] && [ -e
/etc/etckeeper/etckeeper.conf ]; then
                AVOID_SPECIAL_FILE_WARNING=1
                export AVOID_SPECIAL_FILE_WARNING
                if etckeeper unclean; then
-                       etckeeper commit "daily autocommit" >/dev/null
+                       etckeeper commit "daily autocommit" $@ >/dev/null
                fi
        fi
 fi
diff --git a/systemd/etckeeper.service b/systemd/etckeeper.service
index faf1119..b0ae603 100644
--- a/systemd/etckeeper.service
+++ b/systemd/etckeeper.service
@@ -9,4 +9,10 @@ Before=shutdown.target
 [Service]
 Type=oneshot
 ExecStart=/etc/etckeeper/daily
+# Track systemd unit files in /lib/systemd
+# First init a repository with
+# etckeeper init -d /lib/systemd && cd /lib/systemd && git commit -m
"opening commit: 0pointer gambit" && cd -
+# Then uncomment below
+#ExecStart=/etc/etckeeper/daily -d /lib/systemd
+# Finally: systemctl reload-daemon
 IOSchedulingClass=idle