mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Added crash restart support for non Upstart Init services
This commit is contained in:
		
							parent
							
								
									6f806961d1
								
							
						
					
					
						commit
						16799123ec
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -20,7 +20,8 @@ start() {
 | 
			
		|||
    return 1
 | 
			
		||||
  fi
 | 
			
		||||
  echo 'Starting service…' >&2
 | 
			
		||||
  local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
 | 
			
		||||
  local CMD="$SCRIPT -exec \"var child; process.on('SIGTERM', function () { child.removeAllListeners('exit'); child.kill(); process.exit(); }); function start() { child = require('child_process').execFile(process.execPath, [process.argv0, \"\"]); child.stdout.on('data', function (c) { }); child.stderr.on('data', function (c) { }); child.on('exit', function (status) { start(); }); } start();\" &> \"$LOGFILE\" & echo \$!"
 | 
			
		||||
 | 
			
		||||
  cd /usr/local/mesh
 | 
			
		||||
  su -c "$CMD" $RUNAS > "$PIDFILE"
 | 
			
		||||
  echo 'Service started' >&2
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue