Change in osmo-sysmon[master]: Install systemd services with autotools

2018-12-13 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/12286 )

Change subject: Install systemd services with autotools
..


Patch Set 1:

(1 comment)

> (1 comment)
 >
 > In general, see comment on the previous patch: I'm not convinced we
 > would ever run this as daemon because the whole purpose of this is
 > to regularly display stuff on the console. Hence detaching it from
 > the console seems kinda pointless to me.

See my comment in previous patch explaining it may be useful to use it as a 
daemon.

https://gerrit.osmocom.org/#/c/12286/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/12286/1//COMMIT_MSG@7
PS1, Line 7: Install systemd services with autotools
> That's misleading - you're not just installing it, you've also added the 
> service etc. […]
I re-used same commit message I used in most osmocom projects when I added 
systemd bits, so it can be matched to see similar stuff was done here.



--
To view, visit https://gerrit.osmocom.org/12286
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sysmon
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic4875b74bcf2b6232d915070b77fc202a03ef997
Gerrit-Change-Number: 12286
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Thu, 13 Dec 2018 11:37:31 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-sysmon[master]: Install systemd services with autotools

2018-12-13 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12286 )

Change subject: Install systemd services with autotools
..


Patch Set 1:

(1 comment)

In general, see comment on the previous patch: I'm not convinced we would ever 
run this as daemon because the whole purpose of this is to regularly display 
stuff on the console. Hence detaching it from the console seems kinda pointless 
to me.

https://gerrit.osmocom.org/#/c/12286/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/12286/1//COMMIT_MSG@7
PS1, Line 7: Install systemd services with autotools
That's misleading - you're not just installing it, you've also added the 
service etc. More elaborate description please in such cases.



--
To view, visit https://gerrit.osmocom.org/12286
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sysmon
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic4875b74bcf2b6232d915070b77fc202a03ef997
Gerrit-Change-Number: 12286
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Max 
Gerrit-Comment-Date: Thu, 13 Dec 2018 11:11:12 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-sysmon[master]: Install systemd services with autotools

2018-12-13 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12286 )

Change subject: Install systemd services with autotools
..


Patch Set 1: Code-Review-1


--
To view, visit https://gerrit.osmocom.org/12286
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sysmon
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic4875b74bcf2b6232d915070b77fc202a03ef997
Gerrit-Change-Number: 12286
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Thu, 13 Dec 2018 11:11:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sysmon[master]: Install systemd services with autotools

2018-12-12 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/12286


Change subject: Install systemd services with autotools
..

Install systemd services with autotools

Change-Id: Ic4875b74bcf2b6232d915070b77fc202a03ef997
---
M Makefile.am
M configure.ac
A contrib/Makefile.am
A contrib/systemd/Makefile.am
A contrib/systemd/osmo-sysmon.service
5 files changed, 41 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sysmon refs/changes/86/12286/1

diff --git a/Makefile.am b/Makefile.am
index a838715..6018753 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,6 @@
-SUBDIRS = doc src
+SUBDIRS = contrib doc src

 ACLOCAL_AMFLAGS = -I m4
+
+AM_DISTCHECK_CONFIGURE_FLAGS = \
+   --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
diff --git a/configure.ac b/configure.ac
index 734ac99..ba44f98 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,6 +120,23 @@
CPPFLAGS="$CPPFLAGS -pg"
 fi

+# https://www.freedesktop.org/software/systemd/man/daemon.html
+PKG_PROG_PKG_CONFIG
+AC_ARG_WITH([systemdsystemunitdir],
+ [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd 
service files])],,
+ [with_systemdsystemunitdir=auto])
+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o 
"x$with_systemdsystemunitdir" = "xauto"], [
+ def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir 
systemd)
+
+ AS_IF([test "x$def_systemdsystemunitdir" = "x"],
+   [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
+[AC_MSG_ERROR([systemd support requested but pkg-config unable to query 
systemd package])])
+with_systemdsystemunitdir=no],
+   [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
+AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
+  [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
+
 AC_MSG_RESULT([CFLAGS="$CFLAGS"])
 AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])

@@ -127,6 +144,8 @@
 AM_CONFIG_HEADER(config.h)

 AC_OUTPUT(
+contrib/Makefile
+contrib/systemd/Makefile
 doc/Makefile
 doc/examples/Makefile
 src/Makefile
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 000..3439c97
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = systemd
diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am
new file mode 100644
index 000..10b28d9
--- /dev/null
+++ b/contrib/systemd/Makefile.am
@@ -0,0 +1,6 @@
+EXTRA_DIST = osmo-sysmon.service
+
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+osmo-sysmon.service
+endif
diff --git a/contrib/systemd/osmo-sysmon.service 
b/contrib/systemd/osmo-sysmon.service
new file mode 100644
index 000..50d6639
--- /dev/null
+++ b/contrib/systemd/osmo-sysmon.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Osmocom System Monitoring daemon
+
+[Service]
+Type=simple
+Restart=always
+ExecStart=/usr/bin/osmo-sysmon -c /etc/osmocom/osmo-sysmon.cfg
+RestartSec=2
+
+[Install]
+WantedBy=multi-user.target

--
To view, visit https://gerrit.osmocom.org/12286
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sysmon
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4875b74bcf2b6232d915070b77fc202a03ef997
Gerrit-Change-Number: 12286
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol