nl_tokens: Stop all running applications .
pl_tokens: function ( callback ) { var cozyLight = require ( './cozy-light' ) ; if ( cozyLight . getStatus ( ) === 'started' ) { cozyLight . setStopped ( ) ; logger . info ( 'Stopping apps...' ) ; return applicationHelpers . stopAll ( function ( appErr ) { if ( appErr ) { logger . error ( 'An error occurred while stopping applications' ) ; logger . raw ( appErr ) ; } logger . info ( 'Stopping plugins...' ) ; pluginHelpers . stopAll ( function ( pluginErr ) { if ( pluginErr ) { logger . error ( 'An error occurred while stopping plugins' ) ; logger . raw ( pluginErr ) ; } logger . info ( 'Stopping server...' ) ; var timeout = nodeHelpers . throwTimeout ( 'main server is too slow to stop...' , 5000 ) ; mainAppHelper . stop ( function ( ) { clearTimeout ( timeout ) ; logger . info ( '\t' + symbols . <mask> + '\tmain server' ) ; nodeHelpers . invoke ( callback ) ; } ) ; } ) ; } ) ; } logger . debug ( 'Apps already stopped' ) ; return nodeHelpers . invoke ( callback ) ; }