Vm-wekan init script didn't stop node


#1

Hi
I use Wekan-vm v0.10.1 and I had to modify the init file for stop/ restart the service properly.
it’s not very clean but that work!

Source :
stop() {
if [ -f $PIDFILE ]; then
echo "Shutting down $NAME"
rm -f $PIDFILE
RETVAL=$?
else
echo "$NAME is not running."
RETVAL=0
fi
}

New stop function :
stop() {
if [ -f $PIDFILE ]; then
echo "Shutting down $NAME"
rm -f $PIDFILE
RETVAL=$?
PID=$(pidof $NODE_PATH/node)
for i in $PID
do
# kill node
kill $i
done
else
echo "$NAME is not running."
RETVAL=0
fi
}

Without this change, “service wekan restart” will start 1 instance more