<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12286">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Install systemd services with autotools<br><br>Change-Id: Ic4875b74bcf2b6232d915070b77fc202a03ef997<br>---<br>M Makefile.am<br>M configure.ac<br>A contrib/Makefile.am<br>A contrib/systemd/Makefile.am<br>A contrib/systemd/osmo-sysmon.service<br>5 files changed, 41 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-sysmon refs/changes/86/12286/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Makefile.am b/Makefile.am</span><br><span>index a838715..6018753 100644</span><br><span>--- a/Makefile.am</span><br><span>+++ b/Makefile.am</span><br><span>@@ -1,3 +1,6 @@</span><br><span style="color: hsl(0, 100%, 40%);">-SUBDIRS = doc src</span><br><span style="color: hsl(120, 100%, 40%);">+SUBDIRS = contrib doc src</span><br><span> </span><br><span> ACLOCAL_AMFLAGS = -I m4</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+AM_DISTCHECK_CONFIGURE_FLAGS = \</span><br><span style="color: hsl(120, 100%, 40%);">+        --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)</span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 734ac99..ba44f98 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -120,6 +120,23 @@</span><br><span>    CPPFLAGS="$CPPFLAGS -pg"</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+# https://www.freedesktop.org/software/systemd/man/daemon.html</span><br><span style="color: hsl(120, 100%, 40%);">+PKG_PROG_PKG_CONFIG</span><br><span style="color: hsl(120, 100%, 40%);">+AC_ARG_WITH([systemdsystemunitdir],</span><br><span style="color: hsl(120, 100%, 40%);">+     [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,</span><br><span style="color: hsl(120, 100%, 40%);">+     [with_systemdsystemunitdir=auto])</span><br><span style="color: hsl(120, 100%, 40%);">+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [</span><br><span style="color: hsl(120, 100%, 40%);">+     def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     AS_IF([test "x$def_systemdsystemunitdir" = "x"],</span><br><span style="color: hsl(120, 100%, 40%);">+   [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],</span><br><span style="color: hsl(120, 100%, 40%);">+    [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])</span><br><span style="color: hsl(120, 100%, 40%);">+    with_systemdsystemunitdir=no],</span><br><span style="color: hsl(120, 100%, 40%);">+   [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])</span><br><span style="color: hsl(120, 100%, 40%);">+AS_IF([test "x$with_systemdsystemunitdir" != "xno"],</span><br><span style="color: hsl(120, 100%, 40%);">+      [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])</span><br><span style="color: hsl(120, 100%, 40%);">+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> AC_MSG_RESULT([CFLAGS="$CFLAGS"])</span><br><span> AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])</span><br><span> </span><br><span>@@ -127,6 +144,8 @@</span><br><span> AM_CONFIG_HEADER(config.h)</span><br><span> </span><br><span> AC_OUTPUT(</span><br><span style="color: hsl(120, 100%, 40%);">+    contrib/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+    contrib/systemd/Makefile</span><br><span>     doc/Makefile</span><br><span>     doc/examples/Makefile</span><br><span>     src/Makefile</span><br><span>diff --git a/contrib/Makefile.am b/contrib/Makefile.am</span><br><span>new file mode 100644</span><br><span>index 0000000..3439c97</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/Makefile.am</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+SUBDIRS = systemd</span><br><span>diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am</span><br><span>new file mode 100644</span><br><span>index 0000000..10b28d9</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/systemd/Makefile.am</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+EXTRA_DIST = osmo-sysmon.service</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if HAVE_SYSTEMD</span><br><span style="color: hsl(120, 100%, 40%);">+systemdsystemunit_DATA = \</span><br><span style="color: hsl(120, 100%, 40%);">+        osmo-sysmon.service</span><br><span style="color: hsl(120, 100%, 40%);">+endif</span><br><span>diff --git a/contrib/systemd/osmo-sysmon.service b/contrib/systemd/osmo-sysmon.service</span><br><span>new file mode 100644</span><br><span>index 0000000..50d6639</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/systemd/osmo-sysmon.service</span><br><span>@@ -0,0 +1,11 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[Unit]</span><br><span style="color: hsl(120, 100%, 40%);">+Description=Osmocom System Monitoring daemon</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[Service]</span><br><span style="color: hsl(120, 100%, 40%);">+Type=simple</span><br><span style="color: hsl(120, 100%, 40%);">+Restart=always</span><br><span style="color: hsl(120, 100%, 40%);">+ExecStart=/usr/bin/osmo-sysmon -c /etc/osmocom/osmo-sysmon.cfg</span><br><span style="color: hsl(120, 100%, 40%);">+RestartSec=2</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[Install]</span><br><span style="color: hsl(120, 100%, 40%);">+WantedBy=multi-user.target</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12286">change 12286</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12286"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sysmon </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic4875b74bcf2b6232d915070b77fc202a03ef997 </div>
<div style="display:none"> Gerrit-Change-Number: 12286 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>