I have /etc/ under version control, and want to clone it to a shared dir (/opt/backup). for this I use the following code:
exec {'git.clone':
path => '/usr/bin',
cwd => '/etc',
creates => "/opt/backup/$::fqdn.etckeeper.git",
command => "git clone --bare . /opt/backup/$::fqdn.etckeeper.git",
}
This fails with the following output:
Debug: Exec[git.clone](provider=posix): Executing 'git clone --bare . /opt/backup/bast.etckeeper.git'
Debug: Executing 'git clone --bare . /opt/backup/bast.etckeeper.git'
Notice: /Stage[main]/Sws::Base::Etckeeper/Exec[git.clone]/returns: Initialized empty Git repository in /opt/backup/bast.etckeeper.git/
Notice: /Stage[main]/Sws::Base::Etckeeper/Exec[git.clone]/returns: error: cannot run git-upload-pack '/etc/.git': No such file or directory
Notice: /Stage[main]/Sws::Base::Etckeeper/Exec[git.clone]/returns: fatal: unable to fork
Error: git clone --bare . /opt/backup/bast.etckeeper.git returned 128 instead of one of [0]
Error: /Stage[main]/Sws::Base::Etckeeper/Exec[git.clone]/returns: change from notrun to 0 failed: git clone --bare . /opt/backup/bast.etckeeper.git returned 128 instead of one of [0]
When I executed the command "git clone --bare . /opt/backup/bast.etckeeper.git" myself it works.
What I also noticed is that it takes some time before the error appears. In that time the directory /opt/backup/bast.etckeeper.git gets created, but then when the command fails it gets removed again. When cloning git starts a subprocess to copy over all the objects, and it is this "fork" which seems to fail.
Any idea why? What can I do about this?
↧