add systemd service/unit
Change-Id: I956cd9e7ff378a6372524175a1c83416be45610b
This commit is contained in:
parent
d32bd186a3
commit
e1145c53e3
|
@ -1,6 +1,7 @@
|
|||
AUTOMAKE_OPTIONS = foreign dist-bzip2
|
||||
|
||||
SUBDIRS = \
|
||||
contrib \
|
||||
doc \
|
||||
src \
|
||||
include \
|
||||
|
@ -16,6 +17,10 @@ EXTRA_DIST = \
|
|||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libosmo-e1d.pc
|
||||
|
||||
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
|
||||
|
||||
|
||||
@RELMAKE@
|
||||
|
||||
BUILT_SOURCES = $(top_srcdir)/.version
|
||||
|
|
18
configure.ac
18
configure.ac
|
@ -72,8 +72,26 @@ then
|
|||
CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
|
||||
fi
|
||||
|
||||
# https://www.freedesktop.org/software/systemd/man/daemon.html
|
||||
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_OUTPUT(
|
||||
Makefile
|
||||
contrib/Makefile
|
||||
contrib/systemd/Makefile
|
||||
doc/Makefile
|
||||
doc/examples/Makefile
|
||||
src/Makefile
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
SUBDIRS = systemd
|
|
@ -0,0 +1,6 @@
|
|||
EXTRA_DIST = osmo-e1d.service
|
||||
|
||||
if HAVE_SYSTEMD
|
||||
systemdsystemunit_DATA = \
|
||||
osmo-e1d.service
|
||||
endif
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=Osmocom E1 Interface Daemon
|
||||
Wants=osmo-e1d.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/osmo-e1d -c /etc/osmocom/osmo-e1d.cfg
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,2 +1,3 @@
|
|||
/etc/osmocom/osmo-e1d.cfg
|
||||
lib/systemd/system/osmo-e1d.service
|
||||
usr/bin/osmo-e1d
|
||||
|
|
Loading…
Reference in New Issue