diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-09-30 02:01:10 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-10-04 12:29:56 +0200 |
commit | 8e51241a50531dc10d00e54aee00a24fc6760811 (patch) | |
tree | a3006b639224047e1b55924746c8727de1d7f1fe | |
parent | 2cc5fbd49fdca20cdeb8eb81455bc1baef627a77 (diff) | |
download | rsyslog-8e51241a50531dc10d00e54aee00a24fc6760811.tar.gz rsyslog-8e51241a50531dc10d00e54aee00a24fc6760811.tar.xz rsyslog-8e51241a50531dc10d00e54aee00a24fc6760811.zip |
systemd: install service and socket unit files
This adds a systemd socket and service unit file to the default install
if systemd is found or explicitly enabled in ./configure.
Patch is against current git v5-devel.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.am | 25 | ||||
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | rsyslog.service.in | 8 | ||||
-rw-r--r-- | rsyslog.socket | 8 |
5 files changed, 51 insertions, 2 deletions
@@ -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 |