Support for reloading nodebb via the nodebb executable

v1.18.x
Julian Lam 11 years ago
parent df4b555717
commit 783481e644

@ -41,6 +41,7 @@ Loader.init = function(callback) {
} }
process.on('SIGHUP', Loader.restart); process.on('SIGHUP', Loader.restart);
process.on('SIGUSR2', Loader.reload);
callback(); callback();
}; };

@ -43,7 +43,7 @@ case "$1" in
fi fi
;; ;;
reload|restart) restart)
pidExists; pidExists;
if [ 0 -eq $? ]; if [ 0 -eq $? ];
then then
@ -54,6 +54,17 @@ case "$1" in
fi fi
;; ;;
reload)
pidExists;
if [ 0 -eq $? ];
then
echo "NodeBB could not be reloaded, as a running instance could not be found.";
else
echo "Reloading NodeBB.";
kill -12 $(cat pidfile);
fi
;;
status) status)
pidExists; pidExists;
if [ 0 -eq $? ]; if [ 0 -eq $? ];

Loading…
Cancel
Save