5

I'm working on a server with several admin users. Each of them can use sudo to make configuration changes. We're keepeing our /etc directory version-controlled using etckeeper.

However, when I or another admin calls sudo etckeeper commit COMMITMESSAGE, git uses the root user's name and e-mail for the commit message. Setting git config user.name on the etc repository doesn't work in this case, because then each time etckeeper commit is called, the same data will be used.

What I want is the actual user's name and email be present in the etckeeper git repository, so that from the commit log I can track down who did which change.

Any help is greatly appreciated!

andreas-h
  • 1,054
  • 1
  • 16
  • 27
  • 4
    That's strange, as the man page states `Note that etckeeper commit will notice if a user has used sudo or su to become root, and record the original username in the commit.` – Sven Dec 29 '12 at 17:36

1 Answers1

1

I just tested this out and got this for my output on git log:

commit 1a8e8fb2952cd6e80f0a5211e8d4e8f698fbd02c
Author: ngrayson <ngrayson@<hostname>
Date:   Thu Jan 10 18:09:47 2013 +0000

    init

So it looks like it should grab the user and not run it as root.

nicgrayson
  • 21
  • 2