code: func (srv *endlessServer) RegisterSignalHook(prePost int, sig os.Signal, f func()) (err error) {
  	if prePost != PRE_SIGNAL && prePost != POST_SIGNAL {
  		err = fmt.Errorf("Cannot use %v for prePost arg. Must be endless.PRE_SIGNAL or endless.POST_SIGNAL.", sig)
  		return
  	}
  	for _, s := range hookableSignals {
  		if s == sig {
  			srv.SignalHooks[prePost][sig] = append(srv.SignalHooks[prePost][sig], f)
  			return
  		}
  	}
  	err = fmt.Errorf("Signal %v is not supported.", sig)
  	return
  }
docs: /*
  RegisterSignalHook registers a function to be run PRE_SIGNAL or POST_SIGNAL for
  a given signal. PRE or POST in this case means before or after the signal
  related code endless itself runs
  */