summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile.am25
-rw-r--r--configure.ac10
-rw-r--r--rsyslog.service.in8
-rw-r--r--rsyslog.socket8
5 files changed, 51 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index bc362e7f..55f069ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,9 +25,11 @@ install-sh
missing
compile
rsyslogd
+rsyslog.service
*.orig
rg.conf*
*.swp
+*.cache
# some common names I use during development
utils
tmp*
diff --git a/Makefile.am b/Makefile.am
index bc6d8dd0..f3dca447 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,6 +39,25 @@ lmgssutil_la_LDFLAGS = -module -avoid-version
lmgssutil_la_LIBADD = $(GSS_LIBS)
endif
+#
+# systemd support
+#
+if HAVE_SYSTEMD
+
+dist_systemdsystemunit_DATA = \
+ rsyslog.socket
+
+nodist_systemdsystemunit_DATA = \
+ rsyslog.service
+
+CLEANFILES = \
+ rsyslog.service
+
+%.service: %.service.in
+ $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+
+endif
+
EXTRA_DIST = \
freebsd/rsyslogd \
slackware/rc.rsyslogd \
@@ -47,7 +66,8 @@ EXTRA_DIST = \
COPYING.LESSER \
contrib/gnutls/ca.pem \
contrib/gnutls/cert.pem \
- contrib/gnutls/key.pem
+ contrib/gnutls/key.pem \
+ rsyslog.service.in
SUBDIRS = doc runtime . plugins/immark plugins/imuxsock plugins/imtcp plugins/imudp plugins/omtesting
@@ -196,5 +216,6 @@ DISTCHECK_CONFIGURE_FLAGS= --enable-gssapi_krb5 \
--enable-shave \
--enable-extended-tests \
--enable-impstats \
- --enable-memcheck
+ --enable-memcheck \
+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index 1050981b..16454d00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -360,6 +360,16 @@ if test "$enable_unlimited_select" = "yes"; then
fi
+# support for systemd unit files
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test "x$with_systemdsystemunitdir" != xno; then
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+
+
# debug
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[Enable debug mode @<:@default=no@:>@])],
diff --git a/rsyslog.service.in b/rsyslog.service.in
new file mode 100644
index 00000000..b660f6bc
--- /dev/null
+++ b/rsyslog.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=System Logging Service
+
+[Service]
+ExecStart=@sbindir@/rsyslogd -n -c 4
+
+[Install]
+WantedBy=multi-user.target
diff --git a/rsyslog.socket b/rsyslog.socket
new file mode 100644
index 00000000..0cd86054
--- /dev/null
+++ b/rsyslog.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=Syslog Socket
+
+[Socket]
+ListenDatagram=/dev/log
+
+[Install]
+WantedBy=sockets.target