-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrunldm.sh
executable file
·50 lines (40 loc) · 1.05 KB
/
runldm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# limit max number of open files to force pqact to close open file descriptors.
ulimit -n 1024
set -e
set -x
export PATH=/home/ldm/bin:$PATH
trap "echo TRAPed signal" HUP INT QUIT KILL TERM
/usr/sbin/crond
regutil -s docker.localhost.local /hostname
if [ ! -f /home/ldm/var/queues/ldm.pq ]
then
echo "The product queue file home/ldm/var/queues/ldm.pq does not exist. Making new queue."
ldmadmin mkqueue
else
# queue exists, test queue "sanity"
echo "Checking existing product queue with 'pqcat'"
pqcat -l- -s && pqcheck -F
if [ $? -eq 0 ]
then
echo "Using existing LDM product queue."
else
echo "Product queue appears corrupt. Deleting and rebuilding."
ldmadmin delqueue
ldmadmin mkqueue
fi
fi
# In case of unclean shutdown, remove pid and lck files
echo "Running 'ldmadmin clean'."
ldmadmin clean
echo "Starting LDM..."
ldmadmin start
echo "LDM is running."
# never exit
while true; do sleep 10000; done
#ldmadmin watch
#sleep 10
#echo ""
#echo ""
#echo "Hit [RETURN] to exit"
#read