/[gentoo-x86]/eclass/systemd.eclass
Gentoo

Diff of /eclass/systemd.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.29 Revision 1.30
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.29 2013/09/11 08:53:18 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.30 2013/09/12 11:46:41 mgorny Exp $
4 4
5# @ECLASS: systemd.eclass 5# @ECLASS: systemd.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# systemd@gentoo.org 7# systemd@gentoo.org
8# @BLURB: helper functions to install systemd units 8# @BLURB: helper functions to install systemd units
128 debug-print-function ${FUNCNAME} "${@}" 128 debug-print-function ${FUNCNAME} "${@}"
129 129
130 ( 130 (
131 insinto "$(_systemd_get_unitdir)" 131 insinto "$(_systemd_get_unitdir)"
132 newins "${@}" 132 newins "${@}"
133 )
134}
135
136# @FUNCTION: systemd_install_serviced
137# @USAGE: <conf-file> [<service.d>]
138# @DESCRIPTION:
139# Install the file <conf-file> as service.d/00gentoo.conf template.
140# The <service.d> argument specifies the configured service name.
141# If not specified, the configuration file name will be used with .conf
142# suffix stripped (e.g. foo.service.conf -> foo.service).
143systemd_install_serviced() {
144 debug-print-function ${FUNCNAME} "${@}"
145
146 local src=${1}
147 local service=${2}
148
149 [[ ${src} ]] || die "No file specified"
150
151 if [[ ! ${service} ]]; then
152 [[ ${src} == *.conf ]] || die "Source file needs .conf suffix"
153 service=${src##*/}
154 service=${service%.conf}
155 fi
156 # avoid potentially common mistake
157 [[ ${service} == *.d ]] && die "Service must not have .d suffix"
158
159 (
160 insinto /etc/systemd/system/"${service}".d
161 newins "${src}" 00gentoo.conf
133 ) 162 )
134} 163}
135 164
136# @FUNCTION: systemd_dotmpfilesd 165# @FUNCTION: systemd_dotmpfilesd
137# @USAGE: <tmpfilesd>... 166# @USAGE: <tmpfilesd>...

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20