Skip to content

Commit

Permalink
Add systemd service files for nextepc daemons
Browse files Browse the repository at this point in the history
  • Loading branch information
laf0rge committed Oct 18, 2017
1 parent 4bce6df commit ae6f100
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = lib src test
SUBDIRS = lib src test support/systemd

bin_PROGRAMS = nextepc-mmed nextepc-hssd nextepc-sgwd nextepc-pgwd nextepc-pcrfd nextepc-epcd

Expand Down
24 changes: 24 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,29 @@ adl_RECURSIVE_EVAL(["${sysconfdir}"], [SYSCONF_DIR])
AC_SUBST(LIB_DIR)
AC_SUBST(SYSCONF_DIR)

AC_SUBST(systemd_unit_dir)
AC_ARG_WITH(
systemd-unit-dir,
AS_HELP_STRING(
[--with-systemdsystemunitdir=DIR],
[systemd unit directory @<:@SYSTEMD_UNIT_DIR@:>@
Defaults to the correct value for debian /etc/systemd/system/]
),
[
systemd_unit_dir="$withval"
],
[
# default to the systemd admin unit directory
which pkg-config
pkg_config_exists=$?
if test x"$pkg_config_exists" = x"0"; then
systemd_unit_dir=`pkg-config systemd --variable=systemdsystemunitdir`
else
systemd_unit_dir="/etc/systemd/system/"
fi
]
)

##################################
#### Checks for header files. ####
##################################
Expand Down Expand Up @@ -380,6 +403,7 @@ AC_CONFIG_FILES([support/freeDiameter/hss.conf])
AC_CONFIG_FILES([support/freeDiameter/pgw.conf])
AC_CONFIG_FILES([support/freeDiameter/pcrf.conf])
#AC_CONFIG_FILES([support/freeDiameter/dict_legacy_xml.conf])
AC_CONFIG_FILES([support/systemd/Makefile])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends: debhelper (>= 9),
pkg-config,
git,
dh-autoreconf,
dh-systemd,
flex,
bison,
libsctp-dev,
Expand Down
1 change: 1 addition & 0 deletions debian/nextepc-hss.install
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ usr/bin/nextepc-hssd
etc/freeDiameter/hss.conf
etc/freeDiameter/hss.cert.pem
etc/freeDiameter/hss.key.pem
lib/systemd/system/nextepc-hssd.service
1 change: 1 addition & 0 deletions debian/nextepc-mme.install
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ usr/bin/nextepc-mmed
etc/freeDiameter/mme.conf
etc/freeDiameter/mme.cert.pem
etc/freeDiameter/mme.key.pem
lib/systemd/system/nextepc-mmed.service
1 change: 1 addition & 0 deletions debian/nextepc-pcrf.install
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ usr/bin/nextepc-pcrfd
etc/freeDiameter/pcrf.conf
etc/freeDiameter/pcrf.cert.pem
etc/freeDiameter/pcrf.key.pem
lib/systemd/system/nextepc-pcrfd.service
1 change: 1 addition & 0 deletions debian/nextepc-pgw.install
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ usr/bin/nextepc-pgwd
etc/freeDiameter/pgw.conf
etc/freeDiameter/pgw.cert.pem
etc/freeDiameter/pgw.key.pem
lib/systemd/system/nextepc-pgwd.service
1 change: 1 addition & 0 deletions debian/nextepc-sgw.install
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
usr/bin/nextepc-sgwd
lib/systemd/system/nextepc-sgwd.service
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
dh $@ --with autoreconf
dh $@ --with autoreconf --with systemd

override_dh_auto_test:
# skip 'make test' as currently it expects config/log in system paths
13 changes: 13 additions & 0 deletions support/systemd/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
unitfiles = \
nextepc-mmed.service \
nextepc-sgwd.service \
nextepc-pgwd.service \
nextepc-pcrfd.service \
nextepc-hssd.service \
$(NULL)

unitdir = ${systemd_unit_dir}

unit_DATA = $(unitfiles)

EXTRA_DIST = $(unitfiles)
13 changes: 13 additions & 0 deletions support/systemd/nextepc-hssd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=NextEPC HSS Daemon
After=networking.service

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/nextepc-hssd -f /etc/nextepc/hss.cfg
RestartSec=2
RestartPreventExitStatus=1

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions support/systemd/nextepc-mmed.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=NextEPC MME Daemon
After=networking.service

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/nextepc-mmed -f /etc/nextepc/mme.cfg
RestartSec=2
RestartPreventExitStatus=1

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions support/systemd/nextepc-pcrfd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=NextEPC PCRF Daemon
After=networking.service

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/nextepc-pcrfd -f /etc/nextepc/pcrfd.cfg
RestartSec=2
RestartPreventExitStatus=1

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions support/systemd/nextepc-pgwd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=NextEPC S-GW Daemon
After=networking.service

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/nextepc-pgwd -f /etc/nextepc/pgw.cfg
RestartSec=2
RestartPreventExitStatus=1

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions support/systemd/nextepc-sgwd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=NextEPC S-GW Daemon
After=networking.service

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/nextepc-sgwd -f /etc/nextepc/sgw.cfg
RestartSec=2
RestartPreventExitStatus=1

[Install]
WantedBy=multi-user.target

0 comments on commit ae6f100

Please sign in to comment.