Skip to content

Instantly share code, notes, and snippets.

@joseivanlopez
Last active July 18, 2018 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joseivanlopez/db8ceba9781692b71d3597de274d6ff0 to your computer and use it in GitHub Desktop.
Save joseivanlopez/db8ceba9781692b71d3597de274d6ff0 to your computer and use it in GitHub Desktop.

Action depending on current status:

Status Start Stop Restart Reload
Socket running on demand ? start : stop stop socket? nothing? nothing?
Service running nothing? stop service restart service reload service ( if it support, otherwise restart???)
Socket & Service running nothing? stop service and socket? stop service? reload service?
nothing runs start socket or service or depends on start mode? nothing? nothing or start? nothing or start?

Actions over a SystemService

SystemService status

  • [1] A service is stopped when neither the systemd socket nor service are running
  • [2] A service is running when the systemd socket and/or service are running

Start

  • Target

    • when the service is stopped (see [1]), the service is started again (see [2])
  • Actions

    • when neither systemd socket nor service are running
      • and start mode is on demand
        • starts systemd socket
      • and start mode is on boot or manually
        • starts systemd service

Stop

  • Target

    • service is stopped (see [1])
  • Actions

    • stops systemd service if it is running
    • stops systemd socket if it is running

Restart

  • Target

    • service is stopped (see [1]) and started again (see [2])
  • Actions

    • calls to "stop service action" (see stop section) if the service is running (see [2])
    • calls to "start service action" (see start section)

Reload

  • Target

    • service is reloaded or restarted or started
  • Actions

    • when the service supports reload
      • and start mode is on demand
        • and systemd socket is running
          • and systemd service is running
            • reloads systemd service
        • and systemd socket is not running
          • and systemd service is running
            • reloads systemd service
          • and systemd service is not running
            • calls to "start service action" (see start section)
      • and start mode is on boot or manually
        • stops systemd socket if it is running
        • and systemd service is running
          • reloads systemd service
        • and systemd service is not running
          • starts systemd service
    • when service does not support reload
      • calls to "restart service action" (see restart section)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment