summaryrefslogtreecommitdiff
path: root/bin/buildrc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2015-10-03 16:29:43 +0100
committerV3n3RiX <venerix@rogentos.ro>2015-10-03 16:29:43 +0100
commit01e0750c93427cde2b2d19261fefa5d1373e9c37 (patch)
treeb7fb870ea7cf41fbf9174bac1d3f024656b7ccc0 /bin/buildrc
parentdfec061a2da2a936da146db7f261a840faed73ac (diff)
drop any entropy shit in here
Diffstat (limited to 'bin/buildrc')
-rw-r--r--bin/buildrc73
1 files changed, 0 insertions, 73 deletions
diff --git a/bin/buildrc b/bin/buildrc
deleted file mode 100644
index 237f0b2..0000000
--- a/bin/buildrc
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-
-_exec_locked() {
- 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=${?}
- if [ "${rc}" != "0" ]; then
- echo >&2
- echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >&2
- echo "Matter or the Backup Script is running on this chroot" >&2
- echo "Please be patient, it will eventually terminate..." >&2
- echo "Snapshot lock file = ${snapshot_lock_file}" >&2
- echo "Matter lock file = ${matter_lock_file}" >&2
- echo >&2
- echo "This ${1} instance will terminate NOW" >&2
- echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >&2
- echo >&2
- return 1
- else
- # acquire snapshot read lock in non-blocking, shared mode
- (
- flock -s -n 9 || {
- echo "Hello there," >&2;
- echo "a chroot snapshot is in progress..." >&2;
- echo "Try again later." >&2;
- exit 1;
- }
-
- 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 stefan.cristian@rogentos.ro 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}" 10>"${lvm_snapshot_lock_file}"
- return ${?}
- fi
-}
-
-emerge() {
- _exec_locked "/usr/bin/emerge" --quiet-build=y --oneshot "${@}"
- return ${?}
-}
-
-eit() {
- _exec_locked "/usr/bin/eit" "${@}"
- return ${?}
-}
-
-# Alias configuration
-alias cosmos=/particles/cosmos/cosmos