Shepherd

by Daniel Pimentel — Tue 02 February 2016

The GNU Daemon Shepherd or GNU Shepherd, formerly known as GNU dmd, is a service manager that looks after the herd of system services. It provides a replacement for the service-managing capabilities of SysV-init (or any other init) with a both powerful and beautiful dependency-based system with a convenient interface. It is intended for use on GNU/Hurd, but it is supposed to work on every POSIX-like system where Guile is available. In particular, it is used as PID 1 by the Guix System Distribution (GuixSD).

Herd

herd enable foo
herd start foo
herd stop foo
herd status
herd status foo
herd detailed-status 
herd detailed-status foo
herd load shepherd ~/new-service.scm

Service examples

(define foo (make <service>
                     #:provides '(foo)
                     #:start (...)
                     #:stop (...)))
(register-services foo)

Resume

  • shepherd is a daemon, herd the program that controls it.
  • You can start, stop, restart, enable and disable every service, as well as display its status.
  • You can perform additional service-specific actions, which you can also list.
  • Actions can have arguments.
  • You can display the status of a service, even if the service does not provide a specific implementation for this action. The same is true for restarting.
  • The root/shepherd service is used to control shepherd itself.
GNU Shepherd
2000-2016 by Daniel Pimentel under GFDL