I did some research and found out that there is no good way to avoid etckeeper commit "daily autocommit" exiting with status code other than zero if there is a git repository under the /etc hierarchy? This causes the /etc/cron.daily/etckeeper to send an e-mail every day with body "run-parts: /etc/cron.daily/etckeeper exited with return code 1."
I've attempted to add the repo as git submodule in /etc/.gitmodules and tried to add "-path ./myrepo -prune -o" to the NOVCS in /etc/etckeeper/pre-commit.d/30store-metadata but neither of these fixed the issue.
If I have a git repo in /etc/myrepo:
# etckeeper commit "daily autocommit"
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: myrepo (untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
# echo $?
1
What are you trying to achieve here? I'm not sure what your goal is from the question. Would you rather…
/etc/myrepo
directory entirely/etc/myrepo
as a submodule, then automatically commit submodule changes to the/etc
repositoryIf you just want to disable the non-zero exit status, you can change
/etc/etckeeper/commit.d/50vcs-commit
to suppress the exit status. To do that, change the following lines:to
But all that will do is prevent any errors from being reported, which I suspect isn't what you're after! All
etckeeper commit
is doing is running the scripts in/etc/etckeeper/commit
, though, so you should be able to change it to do whatever you want just by editing those scripts.In that case, I'd recommend just having the directory ignored:
Unfortunately that does not work. I tried all these in /etc/.gitignore:
But I still get the error each time.