Skip to content

Commit

Permalink
Merge pull request #1037 from grondo/systemd-tweaks
Browse files Browse the repository at this point in the history
Small improvements for systemd unit file and install paths
  • Loading branch information
garlick committed Apr 12, 2017
2 parents 6fbe380 + 069208f commit f915009
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/systemd.m4
Expand Up @@ -33,7 +33,7 @@ AC_DEFUN([RRA_WITH_SYSTEMD_UNITDIR],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
[Directory for systemd service files])],
[],
[with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
[with_systemdsystemunitdir=\${prefix}$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
AS_IF([test x"$with_systemdsystemunitdir" != xno],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
AM_CONDITIONAL([HAVE_SYSTEMD],
Expand Down
5 changes: 5 additions & 0 deletions config/x_ac_expand_install_dirs.m4
Expand Up @@ -64,6 +64,11 @@ AC_DEFUN([X_AC_EXPAND_INSTALL_DIRS], [
[Expansion of the "localstatedir" installation directory.])
AC_SUBST([X_LOCALSTATEDIR])
adl_RECURSIVE_EVAL(["$runstatedir"], [X_RUNSTATEDIR])
AC_DEFINE_UNQUOTED([X_RUNSTATEDIR], ["$X_RUNSTATEDIR"],
[Expansion of the "runstatedir" installation directory.])
AC_SUBST([X_RUNSTATEDIR])
adl_RECURSIVE_EVAL(["$libdir"], [X_LIBDIR])
AC_DEFINE_UNQUOTED([X_LIBDIR], ["$X_LIBDIR"],
[Expansion of the "libdir" installation directory.])
Expand Down
7 changes: 6 additions & 1 deletion configure.ac
Expand Up @@ -7,6 +7,12 @@ AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_SRCDIR([NEWS])
AC_CANONICAL_SYSTEM
##
# If runstatedir not explicitly set on command line, use '/run' as default
##
if test "$runstatedir" = '${localstatedir}/run'; then
AC_SUBST([runstatedir],[/run])
fi
X_AC_EXPAND_INSTALL_DIRS

##
Expand Down Expand Up @@ -79,7 +85,6 @@ AX_COMPILE_CHECK_SIZEOF(long long)
AX_COMPILE_CHECK_SIZEOF(uintptr_t, [#include <stdint.h>])
AX_COMPILE_CHECK_SIZEOF(size_t, [#include <stdint.h>])


##
# Checks for library functions
##
Expand Down
2 changes: 1 addition & 1 deletion etc/Makefile.am
@@ -1,5 +1,5 @@
#if HAVE_SYSTEMD
systemdsystemunit_SCRIPTS = flux.service
systemdsystemunit_DATA = flux.service
#endif

noinst_DATA = \
Expand Down
9 changes: 8 additions & 1 deletion etc/flux.service.in
Expand Up @@ -2,11 +2,18 @@
Description=Flux message broker

[Service]
ExecStart=@X_BINDIR@/flux start -o,-Sbroker.rundir=%t/flux,-Ssession-id=%H sleep inf
Environment=FLUX_USERDB_OPTIONS=--default-rolemask=user
ExecStart=@X_BINDIR@/flux start -o,-Sbroker.rundir=@X_RUNSTATEDIR@/flux,-Ssession-id=%H sleep inf
User=flux
Group=flux
RuntimeDirectory=flux
RuntimeDirectoryMode=0755
#
# Delegate cgroup control to user flux, so that systemd doesn't reset
# cgroups for flux initiated processes, and to allow (some) cgroup
# manipulation as user flux.
#
Delegate=yes

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion etc/rc1
Expand Up @@ -12,7 +12,7 @@ flux module load -r all resource-hwloc & pids="$pids $!"
flux module load -r all job
flux module load -r 0 cron sync=hb

flux module load -r 0 userdb
flux module load -r 0 userdb ${FLUX_USERDB_OPTIONS}

wait $pids

Expand Down
2 changes: 1 addition & 1 deletion src/common/libflux/Makefile.am
Expand Up @@ -25,7 +25,7 @@ installed_conf_cppflags = \
-DINSTALLED_WREXECD_PATH=\"$(fluxlibexecdir)/wrexecd\" \
-DINSTALLED_CMDHELP_PATTERN=\"${datadir}/flux/help.d/*.json\" \
-DINSTALLED_NO_DOCS_PATH=\"${datadir}/flux/.nodocs\" \
-DINSTALLED_RUNDIR=\"${localstatedir}/run/flux\"
-DINSTALLED_RUNDIR=\"${runstatedir}/flux\"

intree_conf_cppflags = \
-DINTREE_MODULE_PATH=\"$(abs_top_builddir)/src/modules\" \
Expand Down

0 comments on commit f915009

Please sign in to comment.