Gentoo Development Guide

SYSTEMD.ECLASS

Section: portage (5)
Updated: Nov 2014
Index Return to Main Contents
 

NAME

systemd.eclass - helper functions to install systemd units  

DESCRIPTION

This eclass provides a set of functions to install unit files for sys-apps/systemd within ebuilds.  

EXAMPLE

inherit systemd

src_configure() {
local myeconfargs=(
        --enable-foo
        --disable-bar
        "$(systemd_with_unitdir)"
)

econf "${myeconfargs[@]}"
}
 

FUNCTIONS

systemd_get_unitdir
Output the path for the systemd unit directory (not including ${D}). This function always succeeds, even if systemd is not installed.
systemd_get_userunitdir
Output the path for the systemd user unit directory (not including ${D}). This function always succeeds, even if systemd is not installed.
systemd_get_utildir
Output the path for the systemd utility directory (not including ${D}). This function always succeeds, even if systemd is not installed.
systemd_dounit <unit>...
Install systemd unit(s). Uses doins, thus it is fatal in EAPI 4 and non-fatal in earlier EAPIs.
systemd_newunit <old-name> <new-name>
Install systemd unit with a new name. Uses newins, thus it is fatal in EAPI 4 and non-fatal in earlier EAPIs.
systemd_douserunit <unit>...
Install systemd user unit(s). Uses doins, thus it is fatal in EAPI 4 and non-fatal in earlier EAPIs.
systemd_newuserunit <old-name> <new-name>
Install systemd user unit with a new name. Uses newins, thus it is fatal in EAPI 4 and non-fatal in earlier EAPIs.
systemd_install_serviced <conf-file> [<service.d>]
Install the file <conf-file> as service.d/00gentoo.conf template. The <service.d> argument specifies the configured service name. If not specified, the configuration file name will be used with .conf suffix stripped (e.g. foo.service.conf -> foo.service).
systemd_dotmpfilesd <tmpfilesd>...
Install systemd tmpfiles.d files. Uses doins, thus it is fatal in EAPI 4 and non-fatal in earlier EAPIs.
systemd_newtmpfilesd <old-name> <new-name>.conf
Install systemd tmpfiles.d file under a new name. Uses newins, thus it is fatal in EAPI 4 and non-fatal in earlier EAPIs.
systemd_enable_service <target> <service>
Enable service in desired target, e.g. install a symlink for it. Uses dosym, thus it is fatal in EAPI 4 and non-fatal in earlier EAPIs.
systemd_enable_ntpunit <NN-name> <service>...
Add an NTP service provider to the list of implementations in timedated. <NN-name> defines the newly-created ntp-units.d priority and name, while the remaining arguments list service units that will be added to that file.

Uses doins, thus it is fatal in EAPI 4 and non-fatal in earlier EAPIs.

Doc: http://www.freedesktop.org/wiki/Software/systemd/timedated/

systemd_with_unitdir [<configure-option-name>]
Output '--with-systemdsystemunitdir' as expected by systemd-aware configure scripts. This function always succeeds. Its output may be quoted in order to preserve whitespace in paths. systemd_to_myeconfargs() is preferred over this function.

If upstream does use invalid configure option to handle installing systemd units (e.g. `--with-systemdunitdir'), you can pass the 'suffix' as an optional argument to this function (`$(systemd_with_unitdir systemdunitdir)'). Please remember to report a bug upstream as well.

systemd_with_utildir
Output '--with-systemdsystemutildir' as used by some packages to install systemd helpers. This function always succeeds. Its output may be quoted in order to preserve whitespace in paths.
systemd_to_myeconfargs
Add '--with-systemdsystemunitdir' as expected by systemd-aware configure scripts to the myeconfargs variable used by autotools-utils eclass. Handles quoting automatically.
systemd_update_catalog
Update the journald catalog. This needs to be called after installing or removing catalog files.

If systemd is not installed, no operation will be done. The catalog will be (re)built once systemd is installed.

See: http://www.freedesktop.org/wiki/Software/systemd/catalog

systemd_is_booted
Check whether the system was booted using systemd.

This should be used purely for informational purposes, e.g. warning user that he needs to use systemd. Installed files or application behavior *must not* rely on this. Please remember to check MERGE_TYPE to not trigger the check on binary package build hosts!

Returns 0 if systemd is used to boot the system, 1 otherwise.

See: man sd_booted

 

MAINTAINERS

systemd@gentoo.org
 

REPORTING BUGS

Please report bugs via http://bugs.gentoo.org/  

FILES

/usr/portage/eclass/systemd.eclass  

SEE ALSO

ebuild(5)
http://sources.gentoo.org/eclass/systemd.eclass?view=log


 

Index

NAME
DESCRIPTION
EXAMPLE
FUNCTIONS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:25:02 GMT, November 23, 2014