Skip to content

Instantly share code, notes, and snippets.

@bixu
Last active June 7, 2018 17:31
Show Gist options
  • Save bixu/06eeb1036357837ef3a6fd8b574a87ad to your computer and use it in GitHub Desktop.
Save bixu/06eeb1036357837ef3a6fd8b574a87ad to your computer and use it in GitHub Desktop.
thoughts on service interactions for the Habitat CLI

svcadm commands

enable [–s] Enables the service instances specified by the operands. For each service instance, the assigned restarter will try to bring it to the online state. If the –s option is specified, svcadm enables each service instance and then waits for each service instance to enter the online or degraded state. svcadm will return early if it determines that the service cannot reach these states without administrator intervention.

disable [–s] Disables the service instance specified by the operands.

restart [–s] Requests that the service instances specified by the operands be restarted.

refresh [–s] For each service instance specified by the operands, requests that the assigned restarter update the service's running configuration snapshot with the values from the current configuration.

clear [–s] For each service instance specified by the operands, if the instance is in the maintenance state, signal to the assigned restarter that the service has been repaired.

systemctl unit commands:

Unit Commands

list-units [PATTERN…] List units that systemd currently has in memory.

start PATTERN… Start (activate) one or more units specified on the command line.

stop PATTERN… Stop (deactivate) one or more units specified on the command line.

reload PATTERN… Asks all units listed on the command line to reload their configuration.

restart PATTERN… Stop and then start one or more units specified on the command line.

try-restart PATTERN… Stop and then start one or more units specified on the command line if the units are running. This does nothing if units are not running.

reload-or-restart PATTERN… Reload one or more units if they support it. If not, stop and then start them instead. If the units are not running yet, they will be started.

try-reload-or-restart PATTERN… Reload one or more units if they support it. If not, stop and then start them instead. This does nothing if the units are not running.

isolate UNIT Start the unit specified on the command line and its dependencies and stop all others.

kill PATTERN… Send a signal to one or more processes of the unit.

status [PATTERN…|PID…]] Show terse runtime status information about one or more units, followed by most recent log data from the journal.

show [PATTERN…|JOB…] Show properties of one or more units, jobs, or the manager itself.

cat PATTERN… Show backing files of one or more units.

set-property UNIT PROPERTY=VALUE… Set the specified unit properties at runtime where this is supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment