天天看點

linux 編寫自啟動腳本 常用!/bin/bashchkconfig:2345 90 60description:mongodb star stop

!/bin/bash

chkconfig:2345 90 60

description:mongodb star stop

. /etc/rc.d/init.d/functions

servicename=/data/mongodb-3.2.9/bin/mongod

serviceconfig=/data/mongodb-3.2.9/mongodb.conf

if [ ! -f $servicename ];then

exit 6;

fi

if [ ! -f $serviceconfig ];then

exit 7;

case

linux 編寫自啟動腳本 常用!/bin/bashchkconfig:2345 90 60description:mongodb star stop

servicename -f

linux 編寫自啟動腳本 常用!/bin/bashchkconfig:2345 90 60description:mongodb star stop
linux 編寫自啟動腳本 常用!/bin/bashchkconfig:2345 90 60description:mongodb star stop
linux 編寫自啟動腳本 常用!/bin/bashchkconfig:2345 90 60description:mongodb star stop

RETVAL -ge 1 ]; then

echo 'running'

exit 0

else

echo 'stopped'

exit 1

;;

*)

echo "Usage: $0 {start|stop|restart|status|force-reload}"

exit 2

esac

exit $?

繼續閱讀