 				stdio: 'inherit'
 
 			@process = spawn('sudo', ['-u', @user, 'foreman', 'start'], options)
+			@process.on('exit', @_exitHandler.bind(@))
+			@process.on('error', @_exitHandler.bind(@))
 		@emit('start')
 		callback?()
 

			callback?(arguments...)
		)

	_start: (callback) ->
		if not @process
			options =

			@process = null
			@emit('stop')
			callback?(arguments...)

		spawn('pkill', ['-TERM', '-P', @process.pid], @options).on('exit', handler).on('error', handler)

	_update: (callback) ->
		tasks = [
			# Stop the application if running
			(callback) =>
				if @process
					@_stop(callback)
				else
					callback()

			# Fetch new commits
			(callback) =>
				spawn('git', ['fetch'], @options).on('exit', callback).on('error', callback)

			# Reset our master branch to origin/master
			(callback) =>
				spawn('git', ['reset', '--hard', 'origin/master'], @options).on('exit', callback).on('error', callback)

			# Save the new commit hash
			(callback) =>
