Previous: , Up: Services   [Contents][Index]


4.6 The dmd and unknown services

The service dmd is special, because it is used to control dmd itself. It provides the following actions (in addition to enable, disable and restart which do not make sense here).

status

Displays which services are started and which ones are not.

detailed-status

Displays detailed information about every registered service.

load file

Evaluate the Scheme code in file in a fresh module that uses the (oop goops) and (dmd services) modules—as with the --config option of dmd (see Invoking dmd).

unload service-name

Attempt to remove the service identified by service-name. dmd will first stop the service, if necessary, and then remove it from the list of registered services. Any services depending upon service-name will be stopped as part of this process.

If service-name simply does not exist, output a warning and do nothing. If it exists, but is provided by several services, output a warning and do nothing. This latter case might occur for instance with the fictional service web-server, which might be provided by both apache and nginx. If service-name is the special string and all, attempt to remove all services except for dmd itself.

reload file-name

Unload all known optional services using unload’s all option, then load file-name using load functionality. If file-name does not exist or load encounters an error, you may end up with no defined services. As these can be reloaded at a later stage this is not considered a problem. If the unload stage fails, reload will not attempt to load file-name.

daemonize

Fork and go into the background. This should be called before respawnable services are started, as otherwise we would not get the SIGCHLD signals when they terminate.

enable-persistency

When terminating, safe the list of running services in a file.

disable-persistency

Don’t safe the list of running services when terminating.

The unknown service must be defined by the user and if it exists, is used as a fallback whenever we try to invoke an unknown action of an existing service or use a service that does not exist. This is useful only in few cases, but enables you to do various sorts of unusual things.


Previous: , Up: Services   [Contents][Index]