Nove to new layout

This commit is contained in:
Mario Fetka
2014-11-02 09:42:47 +01:00
parent 68d6318910
commit 250a08b5dd
124 changed files with 5211 additions and 1623 deletions

View File

@@ -1,9 +1,15 @@
#!/bin/bash
# Emerge wrapper, uses matter lock file support to avoid
# concurrent execution
_exec_locked() {
snapshot_lock_file="/var/tmp/.emerge.snapshot.lock"
matter_lock_file="/var/tmp/.matter_resource.lock"
local tmp_dir="/var/tmp"
local lvm_snapshot_lock_file="/.entropy_locks/vg_chroots-lv_chroots-snapshot.lock"
local snapshot_lock_file="${tmp_dir}/.emerge.snapshot.lock"
local matter_lock_file="${tmp_dir}/.matter_resource.lock"
if [ ! -d "${tmp_dir}" ]; then
echo "${tmp_dir} is missing, creating it..." >&2
mkdir -p "${tmp_dir}"
fi
flock -x -n "${matter_lock_file}" true
rc=${?}
@@ -15,7 +21,7 @@ _exec_locked() {
echo "Snapshot lock file = ${snapshot_lock_file}" >&2
echo "Matter lock file = ${matter_lock_file}" >&2
echo >&2
echo "this emerge instance will terminate NOW" >&2
echo "This ${1} instance will terminate NOW" >&2
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >&2
echo >&2
return 1
@@ -24,21 +30,37 @@ _exec_locked() {
(
flock -s -n 9 || {
echo "Hello there," >&2;
echo "a chroot snapshot is in progress..." >%2;
echo "a chroot snapshot is in progress..." >&2;
echo "Try again later." >&2;
exit 1;
}
# eval $(portageq envvar -v FETCHCOMMAND RESUMECOMMAND PORTAGE_RSYNC_OPTS)
# add bandwidth limit here
flock -s --timeout=120 10
if [ "${?}" != "0" ]; then
echo >&2
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >&2
echo "The LVM lock of the Backup Script is being held for 2 minutes" >&2
echo "This should not happen. Please contact lxnay@sabayon.org and" >&2
echo "stop any activity NOW. However, if you're in an emergency" >&2
echo "Just rm ${lvm_snapshot_lock_file} and continue." >&2
echo "Please note that this will cause inconsistent backups." >&2
echo >&2
echo "This instance will terminate NOW" >&2
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >&2
echo >&2
exit 1
fi
"${@}"
exit ${?}
) 9> "${snapshot_lock_file}"
return "${?}"
) 9> "${snapshot_lock_file}" 10>"${lvm_snapshot_lock_file}"
return ${?}
fi
}
emerge() {
_exec_locked "/usr/bin/emerge" "${@}"
_exec_locked "/usr/bin/emerge" --quiet-build=y --oneshot "${@}"
return ${?}
}
@@ -46,3 +68,6 @@ eit() {
_exec_locked "/usr/bin/eit" "${@}"
return ${?}
}
# Alias configuration
alias cosmos=/particles/cosmos/cosmos