def restart
      Procodile.log(@process.log_color, description, "Restarting using #{@process.restart_mode} mode")
      update_pid
      case @process.restart_mode
      when 'usr1', 'usr2'
        if running?
          ::Process.kill(@process.restart_mode.upcase, @pid)
          @tag = @supervisor.tag if @supervisor.tag
          Procodile.log(@process.log_color, description, "Sent #{@process.restart_mode.upcase} signal to process #{@pid}")
        else
          Procodile.log(@process.log_color, description, "Process not running already. Starting it.")
          on_stop
          new_instance = @process.create_instance(@supervisor)
          new_instance.port = self.port
          new_instance.start
        end
        self
      when 'start-term'
        new_instance = @process.create_instance(@supervisor)
        new_instance.start
        stop
        new_instance
      when 'term-start'
        stop
        new_instance = @process.create_instance(@supervisor)
        new_instance.port = self.port
        Thread.new do
          sleep 0.5 while running?
          new_instance.start
        end
        new_instance
      end
    end
def restart
      Procodile.log(@process.log_color, description, "Restarting using #{@process.restart_mode} mode")
      update_pid
      case @process.restart_mode
      when 'usr1', 'usr2'
        if running?
          ::Process.kill(@process.restart_mode.upcase, @pid)
          @tag = @supervisor.tag if @supervisor.tag
          Procodile.log(@process.log_color, description, "Sent #{@process.restart_mode.upcase} signal to process #{@pid}")
        else
          Procodile.log(@process.log_color, description, "Process not running already. Starting it.")
          on_stop
          new_instance = @process.create_instance(@supervisor)
          new_instance.port = self.port
          new_instance.start
        end
        self
      when 'start-term'
        new_instance = @process.create_instance(@supervisor)
        new_instance.start
        stop
        new_instance
      when 'term-start'
        stop
        new_instance = @process.create_instance(@supervisor)
        new_instance.port = self.port
        Thread.new do
          sleep 0.5 while running?
          new_instance.start
        end
        new_instance
      end
    end
Retarts the process using the appropriate method from the process configuraiton