7 CHUNK_DIR
=`cat $KFS_CONF 2>/dev/null | grep chunkServer.chunkDir | cut -d '=' -f 2 | sed 's/ //g'`
8 LOG_DIR
=`cat $KFS_CONF 2>/dev/null | grep chunkServer.logDir | cut -d '=' -f 2 | sed 's/ //g'`
12 stat_busy
"Starting KFS ChunkServer"
14 [ -z "$KFS_CONF" ] && { echo "KFS_CONF not set. You need to specify it in /etc/conf.d/kfs file"; stat_fail
; exit 0; }
15 [ -z "$KFS_DIR" ] && { echo "KFS_DIR not set. You need to specify it in /etc/conf.d/kfs file"; stat_fail
; exit 0; }
17 [ -f "$KFS_CONF" ] ||
{ echo "$KFS_CONF doesn't exist"; stat_fail
; exit 0; }
18 [ -d "$KFS_DIR" ] || mkdir
-p "$KFS_DIR" ||
{ echo "Could not create $KFS_DIR"; stat_fail
; exit 0; }
20 [ -z "$CHUNK_DIR" ] && { echo "$KFS_CONF doesn't have chunkServer.chunkDir set"; stat_fail
; exit 0; }
21 [ -z "$LOG_DIR" ] && { echo "$KFS_CONF doesn't have chunkServer.logDir set"; stat_fail
; exit 0; }
25 [ -d "$CHUNK_DIR" ] || mkdir
-p "$CHUNK_DIR" ||
{ echo "Could not create $CHUNK_DIR directory"; stat_fail
; exit 0; }
26 [ -d "$LOG_DIR" ] || mkdir
-p "$LOG_DIR" ||
{ echo "Could not create $LOG_DIR directory"; stat_fail
; exit 0; }
28 [ -d "bin" ] ||
ln -s /usr
/share
/kfs
/bin ||
{ echo "Could not create link to /usr/share/kfs/bin in $KFS_DIR"; stat_fail
; exit 0; }
29 [ -d "scripts" ] ||
ln -s /usr
/share
/kfs
/scripts ||
{ echo "Could not create link to /usr/share/kfs/scripts in $KFS_DIR"; stat_fail
; exit 0; }
30 [ -d "logs" ] || mkdir
-p "logs" ||
{ echo "Could not create $KFS_DIR/logs"; stat_fail
; exit 0; }
32 scripts
/kfsrun.sh
--start --chunk --file "$KFS_CONF"
37 add_daemon kfs-chunkserv
42 stat_busy
"Stopping KFS ChunkServer"
46 scripts
/kfsrun.sh
--stop --chunk --file "$KFS_CONF"
51 rm_daemon kfs-chunkserv
61 echo "usage: $0 {start|stop|restart}"