Module systemd

Data Types

fd()

fd() = integer() | {integer(), unicode:chardata()}

sd_timeout()

sd_timeout() = pos_integer()

state()

state() = ready | stopping | reloading | watchdog | watchdog_trigger | {status, unicode:chardata()} | {errno, non_neg_integer()} | {buserror, unicode:chardata()} | {extend_timeout, {non_neg_integer(), erlang:time_unit()}} | unicode:chardata()

Function Index

booted/0 Check if system was booted with systemd.
listen_fds/0Equivalent to listen_fds(false).
listen_fds/1 Returns list of file descriptors passed to the application by systemd.
notify/1 Send notification to the systemd socket.
notify/2 Send notification to the systemd socket.
watchdog/1 Manage watchdog process.

Function Details

booted/0

booted() -> {ok, boolean()} | {error, file:posix()}

returns: {ok, true} if system was booted with systemd, {ok,false} if not, and {error, Reason} on error.

Check if system was booted with systemd.

Note that all other functions in this module are safe to call even on non-systemd boots (even on non-systemd platforms). You should NOT protect them with a call to this function. Also note that this checks wheter the system, not the user session, is controlled by systemd. However other functions will work for both - user and system services.

listen_fds/0

listen_fds() -> [fd()]

Equivalent to listen_fds(false).

listen_fds/1

listen_fds(Unset::boolean()) -> [fd()]

returns: List of passed file descriptors. If descriptor have name defined then it will be returned as 2nd value in tuple. Order of returned descriptors is the same as passed in environment.

Returns list of file descriptors passed to the application by systemd.

notify/1

notify(State::state()) -> ok

Send notification to the systemd socket.

notify/2

notify(Format::io:format(), Data::[term()]) -> ok

Send notification to the systemd socket.

This function takes Format and Data that will be formatted in the same way as io:fwrite/2.

watchdog/1

watchdog(X1::state) -> sd_timeout()

Manage watchdog process.


Generated by EDoc