-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage
executable file
·62 lines (50 loc) · 1.29 KB
/
storage
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
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
###############################################################################
## Configuration
###############################################################################
[[ -f "environ" ]] && . "environ"
###############################################################################
pushd `dirname $0` > /dev/null 2>&1
SNAME=dcache@`hostname`
YAWS_CONF=""
if [ $# -gt 1 ]
then
SNAME=$2@`hostname`
if [ $# -gt 2 ]
then
YAWS_CONF="-storage_conf yaws_port $3"
fi
fi
mkdir -p $ROOT/log
mkdir -p $ROOT/files
ln -fs $ROOT/files/$SNAME $ROOT/yaws/$SNAME
mkdir -p $ROOT/priv/log
mkdir -p $ROOT/priv/files
case "$1" in
start)
$ERL \
-boot start_sasl \
-sname $SNAME \
-pa $ROOT/ebin \
-storage_conf config_file_name $ROOT/storage.conf \
-s launcher start \
-smp auto
;;
daemon)
SASL_LOG_FILE=$ROOT/priv/$SNAME/log/sasl.log
$ERL \
-boot start_sasl \
-sname $SNAME \
-sasl sasl_error_logger \{file,\"$SASL_LOG_FILE\"\} \
-pa $ROOT/ebin \
-storage_conf config_file_name $ROOT/storage.conf \
-detached -noshell \
-s launcher start \
-smp auto
;;
*)
echo "Use: $0 { start [name] [port] | daemon [name] [port] }"
exit 1
esac
popd > /dev/null 2>&1
exit 0