func (sv *Unit) Sub() string {
	log.WithField("sv", sv).Debugf("sv.Sub")

	switch {
	case sv.Cmd.Process == nil:
		// Service has not been started yet
		return dead

	case sv.Cmd.ProcessState == nil:
		// Wait has not returned yet
		return running

	case sv.ProcessState.Exited(), sv.ProcessState.Success():
		if sv.Definition.Service.RemainAfterExit {
			return exited
		}
		return dead

	default:
		// Service process has finished, but did not return a 0 exit code
		return failed
	}
}
// Sub reports the sub status of a service
Sub reports the sub status of a service
// Sub reports the sub status of a service
func (sv *Unit) Sub() string {
	log.WithField("sv", sv).Debugf("sv.Sub")
	switch {
	case sv.Cmd.Process == nil:
		return dead
	case sv.Cmd.ProcessState == nil:
		return running
	case sv.ProcessState.Exited(), sv.ProcessState.Success():
		if sv.Definition.Service.RemainAfterExit {
			return exited
		}
		return dead
	default:
		return failed
	}
}
func ( sv * Unit ) Sub ( ) string { log . WithField ( " " , sv ) . Debugf ( " " ) switch { case sv . Cmd . Process == nil : return dead case sv . Cmd . ProcessState == nil : return running case sv . ProcessState . Exited ( ) , sv . ProcessState . Success ( ) : if sv . Definition . Service . RemainAfterExit { return exited } return dead default : return failed } }
Sub reports the sub status of a service
Sub reports the sub status of a service
// Service has not been started yet // Wait has not returned yet // Service process has finished, but did not return a 0 exit code