diff options
author | 2013-07-30 10:29:14 +0200 | |
---|---|---|
committer | 2013-07-30 10:52:44 +0200 | |
commit | 4a535e4d04b38bbe18593947b44d1cbcb9955388 (patch) | |
tree | 2aad120ac01806b410cd88583296757d3501916b | |
parent | Add the /var/lock & /var/run units from ebuild filesdir. (diff) | |
download | gentoo-systemd-integration-4a535e4d04b38bbe18593947b44d1cbcb9955388.tar.gz gentoo-systemd-integration-4a535e4d04b38bbe18593947b44d1cbcb9955388.tar.bz2 gentoo-systemd-integration-4a535e4d04b38bbe18593947b44d1cbcb9955388.zip |
Initial version of local.d support.
-rw-r--r-- | Makefile.am | 26 | ||||
-rwxr-xr-x | bin/gentoo-run-directory | 22 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | services/gentoo-local.service.in | 10 |
4 files changed, 59 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 411f4a1..1c6f985 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,14 +1,36 @@ ACLOCAL_AMFLAGS = -I m4 DISTCHECK_CONFIGURE_FLAGS = \ - --with-systemdsystemunitdir=\$${libdir}/systemd/system + --with-systemdsystemunitdir=\$${libdir}/systemd/system \ + --with-systemdutildir=\$${libdir}/systemd dist_tmpfiles_DATA = \ tmpfiles.d/gentoo-run.conf dist_systemdsystemunit_DATA = \ mounts/var-lock.mount \ mounts/var-run.mount +dist_systemdutil_SCRIPTS = \ + bin/gentoo-run-directory -EXTRA_DIST = NEWS +systemdsystemunit_DATA = \ + services/gentoo-local.service +EXTRA_DIST = \ + services/gentoo-local.service.in +DISTCLEANFILES = \ + $(systemdsystemunit_DATA) + +services/gentoo-local.service: services/gentoo-local.service.in + +$(systemdsystemunit_DATA): config.status + $(MKDIR_P) services + rm -f $@ $@.tmp + $(SED) \ + -e "s|@systemdutildir[@]|$(systemdutildir)|" \ + ${srcdir}/$@.in > $@.tmp + chmod a-w $@.tmp + mv $@.tmp $@ + + +EXTRA_DIST += NEWS NEWS: configure.ac Makefile.am git for-each-ref refs/tags --sort '-*committerdate' \ --format '# %(tag) (%(*committerdate:short))%0a%(contents:body)' \ diff --git a/bin/gentoo-run-directory b/bin/gentoo-run-directory new file mode 100755 index 0000000..93970a2 --- /dev/null +++ b/bin/gentoo-run-directory @@ -0,0 +1,22 @@ +#!/bin/sh + +if [ ${#} -ne 2 ]; then + echo "Synopsis: ${0} <path> .<suffix>" >&2 + exit 1 +fi + +if ! cd "${1}"; then + echo "Unable to cd into ${1}" >&2 + exit 1 +fi + +for f in ./*"${2}"; do + if [ -x "${f}" ]; then + echo "* Starting ${f}" >&2 + if ! "${f}"; then + echo "! Failed to start ${f}: ${?}" >&2 + fi + elif [ -f "${f}" ]; then + echo "* Omitting ${f} (non-executable)" >&2 + fi +done diff --git a/configure.ac b/configure.ac index 8ef759c..a169ca3 100644 --- a/configure.ac +++ b/configure.ac @@ -3,9 +3,12 @@ AC_INIT([gentoo-systemd-integration], [0]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2 subdir-objects]) +AC_PROG_SED + # https://bitbucket.org/mgorny/systemd-sdk/ SYSTEMD_MISC SYSTEMD_SYSTEMUNITDIR +SYSTEMD_UTILDIR AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/services/gentoo-local.service.in b/services/gentoo-local.service.in new file mode 100644 index 0000000..35eb7e6 --- /dev/null +++ b/services/gentoo-local.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Start the files from /etc/local.d +After=multi-user.target graphical.target + +[Service] +Type=forking +TimeoutSec=0 +RemainAfterExit=yes +ExecStart=@systemdutildir@/gentoo-run-directory /etc/local.d .start +ExecStop=@systemdutildir@/gentoo-run-directory /etc/local.d .stop |