summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Savchenko <bircoph@gmail.com>2012-06-06 19:40:19 +0400
committerAndrew Savchenko <bircoph@gmail.com>2012-06-06 19:40:19 +0400
commit3d5b64069f690db8f531e701b1243adbc9cdccc1 (patch)
tree38a44b7cecc16ef8c7c24af345461aaec2aba8e4 /sys-cluster
parentenigma: temporary fix for net-libs/enet conflict (diff)
downloadbircoph-3d5b64069f690db8f531e701b1243adbc9cdccc1.tar.gz
bircoph-3d5b64069f690db8f531e701b1243adbc9cdccc1.tar.bz2
bircoph-3d5b64069f690db8f531e701b1243adbc9cdccc1.zip
torque: add checks for stale lock file
pbs_mom lock file may be stale, this adds forced removal if lock file is older than uptime
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/torque/files/pbs_mom-init.d8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys-cluster/torque/files/pbs_mom-init.d b/sys-cluster/torque/files/pbs_mom-init.d
index 62d474d..4609615 100644
--- a/sys-cluster/torque/files/pbs_mom-init.d
+++ b/sys-cluster/torque/files/pbs_mom-init.d
@@ -24,6 +24,14 @@ checkconfig() {
start() {
checkconfig || return 1
+ # check for a stale lock file, otherwise pbs_mom may fail to
+ # start, see unicluster # 75 bug
+ local utime unchtime
+ utime=$( gawk -F "[ .]" '{ print $1 }' /proc/uptime)
+ unchtime=$(( $(date +%s) - $(stat -c %Y ${PBS_SERVER_HOME}/mom_priv/mom.lock) ))
+ [[ -f ${PBS_SERVER_HOME}/torque/mom_priv/mom.lock ]] &&
+ [[ "$utime" -lt "$unchtime" ]] && rm ${PBS_SERVER_HOME}/mom_priv/mom.lock
+
ebegin "Starting Torque pbs_mom"
local extra_args=""
if [ -n "${PBS_MOM_LOG}" ]; then