diff options
-rw-r--r-- | debian/changelog | 26 | ||||
-rw-r--r-- | debian/control | 3 | ||||
-rw-r--r-- | debian/patches/dyson-imsolaris-no-libdoor.patch | 11 | ||||
-rw-r--r-- | debian/patches/dyson-imuxsock.patch | 13 | ||||
-rw-r--r-- | debian/patches/series | 2 | ||||
-rw-r--r-- | debian/rsyslog.conf | 1 | ||||
-rw-r--r-- | debian/rsyslog.install | 1 | ||||
-rw-r--r-- | debian/rsyslog.logrotate | 12 | ||||
-rw-r--r-- | debian/rsyslog.postinst.smf | 18 | ||||
-rw-r--r-- | debian/rsyslog.prerm.smf | 11 | ||||
-rwxr-xr-x | debian/rules | 25 | ||||
-rw-r--r-- | debian/smf/manifest/system/rsyslog.xml | 54 | ||||
-rw-r--r-- | debian/smf/method/rsyslog | 25 |
13 files changed, 194 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog index e0c850f..07fcdec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -192,6 +192,32 @@ rsyslog (7.3.15-1) unstable; urgency=low -- Michael Biebl <biebl@debian.org> Wed, 15 May 2013 18:21:02 +0200 +rsyslog (7.3.14-2+dyson2) unstable; urgency=low + + * Added dependency on /etc/rsyslog.confin SMF service and thus support for + "offline" state in post-install script. + * Stop SMF service synchronously in prerm (svcadm disable -s) + + -- Igor Pashev <pashev.igor@gmail.com> Mon, 13 May 2013 01:57:30 +0400 + +rsyslog (7.3.14-2+dyson1) unstable; urgency=low + + * Package for Dyson + * Added SMF service + * Build and install imsolaris module for illumos only + * Patched imsolaris not to link with libdoor which is filter on both illumos + libc and glibc + * Disable imklog modules on illumos + * Make rsyslog.conf universal for linux and illumos: + imklog or imsolaris are loaded from corresponding /etc/rsyslog.d/*.conf + * Patched imuxsock to use -D_XPG4_2 to make CMSG_DATA & Ko available + from sys/socket.h on illumos/solaris libc + * Pre-Depends: smf-tools (>= 2.10-5) [illumos-any] + * Depends: initscripts (>= 2.88dsf-13.3) [!illumos-any !kopensolaris-any] + * Make debian/rsyslog.logrotate SMF aware + + -- Igor Pashev <pashev.igor@gmail.com> Sun, 12 May 2013 05:57:06 +0400 + rsyslog (7.3.14-2) unstable; urgency=low * Upload to unstable. diff --git a/debian/control b/debian/control index 1eb7f6c..ca0e0e3 100644 --- a/debian/control +++ b/debian/control @@ -29,6 +29,7 @@ Homepage: http://www.rsyslog.com/ Package: rsyslog Architecture: any Priority: important +Pre-Depends: smf-tools (>= 2.10-5) [illumos-any] Conflicts: system-log-daemon, linux-kernel-log-daemon Provides: system-log-daemon, @@ -36,7 +37,7 @@ Provides: system-log-daemon, Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.2-14), - initscripts (>= 2.88dsf-13.3) + initscripts (>= 2.88dsf-13.3) [!illumos-any !kopensolaris-any] Recommends: logrotate Suggests: rsyslog-mysql | rsyslog-pgsql, rsyslog-mongodb, diff --git a/debian/patches/dyson-imsolaris-no-libdoor.patch b/debian/patches/dyson-imsolaris-no-libdoor.patch new file mode 100644 index 0000000..11cc4ce --- /dev/null +++ b/debian/patches/dyson-imsolaris-no-libdoor.patch @@ -0,0 +1,11 @@ +Description: libdoor is dummy +Index: rsyslog/plugins/imsolaris/Makefile.am +=================================================================== +--- rsyslog.orig/plugins/imsolaris/Makefile.am 2013-05-11 02:56:37.660844354 +0400 ++++ rsyslog/plugins/imsolaris/Makefile.am 2013-05-12 04:03:54.071857271 +0400 +@@ -3,4 +3,4 @@ + imsolaris_la_SOURCES = imsolaris.c sun_cddl.c sun_cddl.h imsolaris.h + imsolaris_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) + imsolaris_la_LDFLAGS = -module -avoid-version +-imsolaris_la_LIBADD = -ldoor -lpthread ++imsolaris_la_LIBADD = -lpthread diff --git a/debian/patches/dyson-imuxsock.patch b/debian/patches/dyson-imuxsock.patch new file mode 100644 index 0000000..ad23be1 --- /dev/null +++ b/debian/patches/dyson-imuxsock.patch @@ -0,0 +1,13 @@ +Description: CMSG_DATA & friends need -D_XPG4_2 on illumos/solaris /libc +Index: rsyslog/plugins/imuxsock/Makefile.am +=================================================================== +--- rsyslog.orig/plugins/imuxsock/Makefile.am 2013-05-11 02:56:37.666642453 +0400 ++++ rsyslog/plugins/imuxsock/Makefile.am 2013-05-12 05:54:48.849834170 +0400 +@@ -1,6 +1,6 @@ + pkglib_LTLIBRARIES = imuxsock.la + + imuxsock_la_SOURCES = imuxsock.c +-imuxsock_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) ++imuxsock_la_CPPFLAGS = -D_XPG4_2 -DSD_EXPORT_SYMBOLS -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) + imuxsock_la_LDFLAGS = -module -avoid-version + imuxsock_la_LIBADD = $(RSRT_LIBS) diff --git a/debian/patches/series b/debian/patches/series index a8e093a..4a52108 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,3 @@ 0001-Don-t-create-a-database.patch +dyson-imsolaris-no-libdoor.patch +dyson-imuxsock.patch diff --git a/debian/rsyslog.conf b/debian/rsyslog.conf index 0e33f48..7f95b66 100644 --- a/debian/rsyslog.conf +++ b/debian/rsyslog.conf @@ -9,7 +9,6 @@ ################# $ModLoad imuxsock # provides support for local system logging -$ModLoad imklog # provides kernel logging support #$ModLoad immark # provides --MARK-- message capability # provides UDP syslog reception diff --git a/debian/rsyslog.install b/debian/rsyslog.install index 03f4b6f..084c5bd 100644 --- a/debian/rsyslog.install +++ b/debian/rsyslog.install @@ -3,7 +3,6 @@ debian/xconsole.conf usr/lib/tmpfiles.d/ usr/sbin/ usr/share/man/ usr/lib/rsyslog/imfile.so -usr/lib/rsyslog/imklog.so usr/lib/rsyslog/immark.so usr/lib/rsyslog/impstats.so usr/lib/rsyslog/imtcp.so diff --git a/debian/rsyslog.logrotate b/debian/rsyslog.logrotate index d75287c..15b4d33 100644 --- a/debian/rsyslog.logrotate +++ b/debian/rsyslog.logrotate @@ -7,7 +7,11 @@ delaycompress compress postrotate - invoke-rc.d rsyslog rotate > /dev/null + if [ -x /usr/sbin/svcadm ]; then + /usr/sbin/svcadm refresh svc:/system/system-log:rsyslog + else + invoke-rc.d rsyslog rotate > /dev/null + fi endscript } @@ -32,6 +36,10 @@ delaycompress sharedscripts postrotate - invoke-rc.d rsyslog rotate > /dev/null + if [ -x /usr/sbin/svcadm ]; then + /usr/sbin/svcadm refresh svc:/system/system-log:rsyslog + else + invoke-rc.d rsyslog rotate > /dev/null + fi endscript } diff --git a/debian/rsyslog.postinst.smf b/debian/rsyslog.postinst.smf new file mode 100644 index 0000000..244b098 --- /dev/null +++ b/debian/rsyslog.postinst.smf @@ -0,0 +1,18 @@ + +fmri=svc:/system/system-log:rsyslog + +if [ "$1" = configure ]; then + state=`svcstatus $fmri` + case "$state" in + online) + # Restart only on upgrades. + # On new install the service will start automatically + if [ -n "$2" ]; then + svcadm -v restart $fmri || true + fi + ;; + maintenance) svcadm -v clear $fmri || true;; + offline) svcadm -v refresh $fmri || true;; + esac +fi + diff --git a/debian/rsyslog.prerm.smf b/debian/rsyslog.prerm.smf new file mode 100644 index 0000000..c0032ea --- /dev/null +++ b/debian/rsyslog.prerm.smf @@ -0,0 +1,11 @@ +fmri=svc:/system/system-log:rsyslog +state=`svcstatus $fmri` + +case "$1" in + remove) + case "$state" in + online) svcadm -v disable -s $fmri || true;; + esac + ;; +esac + diff --git a/debian/rules b/debian/rules index dae9288..f41acfe 100755 --- a/debian/rules +++ b/debian/rules @@ -10,12 +10,17 @@ DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) ifeq ($(DEB_HOST_ARCH_OS), linux) confflags += --enable-imptcp \ - --enable-kmsg + --enable-kmsg \ + --with-systemdsystemunitdir=/lib/systemd/system +endif + +ifeq (illumos,$(DEB_HOST_ARCH_OS)) +confflags += --enable-imsolaris \ + --disable-klog endif override_dh_auto_configure: dh_auto_configure -- \ - $(confflags) \ --enable-mysql \ --enable-pgsql \ --enable-ommongodb \ @@ -43,7 +48,7 @@ override_dh_auto_configure: --disable-libgcrypt \ --disable-testbench \ --disable-generate-man-pages \ - --with-systemdsystemunitdir=/lib/systemd/system + $(confflags) override_dh_auto_install: dh_auto_install @@ -60,6 +65,20 @@ ifeq ($(DEB_HOST_ARCH_OS), linux) install --mode=644 debian/tmp/usr/lib/rsyslog/imptcp.so \ debian/rsyslog/usr/lib/rsyslog/ endif +ifeq (illumos,$(DEB_HOST_ARCH_OS)) + rm -rf debian/rsyslog/etc/systemd + rm -rf debian/rsyslog/lib/systemd + install --mode=644 debian/tmp/usr/lib/rsyslog/imsolaris.so \ + debian/rsyslog/usr/lib/rsyslog/ + echo '$$ModLoad imsolaris' > debian/rsyslog/etc/rsyslog.d/00-load-imsolaris.conf + dh_install -p rsyslog debian/smf/* /lib/svc/ + cat debian/rsyslog.postinst.smf >> debian/rsyslog.postinst.debhelper + cat debian/rsyslog.prerm.smf >> debian/rsyslog.prerm.debhelper +else + install --mode=644 debian/tmp/usr/lib/rsyslog/imklog.so \ + debian/rsyslog/usr/lib/rsyslog/ + echo '$$ModLoad imklog' > debian/rsyslog/etc/rsyslog.d/00-load-imklog.conf +endif override_dh_installinit: dh_installinit -R diff --git a/debian/smf/manifest/system/rsyslog.xml b/debian/smf/manifest/system/rsyslog.xml new file mode 100644 index 0000000..2b3e6d0 --- /dev/null +++ b/debian/smf/manifest/system/rsyslog.xml @@ -0,0 +1,54 @@ +<?xml version="1.0"?> +<!DOCTYPE service_bundle SYSTEM "/usr/share/xml/schema/smf/service_bundle.dtd.1"> +<service_bundle type="manifest" name="rsyslog"> + <service name="system/system-log" type="service" version="1"> + <instance name="rsyslog" enabled="true"> + <dependency name="config_data" grouping="require_all" restart_on="restart" type="path"> + <service_fmri value="file://localhost/etc/rsyslog.conf"/> + </dependency> + <dependency name="milestone" grouping="require_all" restart_on="none" type="service"> + <service_fmri value="svc:/milestone/sysconfig"/> + </dependency> + <dependency name="usr" type="service" grouping="require_all" restart_on="none"> + <service_fmri value="svc:/system/filesystem/local"/> + </dependency> + <dependency name="ns" type="service" grouping="require_all" restart_on="none"> + <service_fmri value="svc:/milestone/name-services"/> + </dependency> + <dependency name="autofs" grouping="optional_all" restart_on="none" type="service"> + <service_fmri value="svc:/system/filesystem/autofs"/> + </dependency> + <dependent name="rsyslog_multi-user" grouping="optional_all" restart_on="none"> + <service_fmri value="svc:/milestone/multi-user"/> + </dependent> + <exec_method type="method" name="start" exec="/lib/svc/method/rsyslog" timeout_seconds="60"> + <method_context> + <method_credential user="root" group="root"/> + </method_context> + </exec_method> + <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"> + </exec_method> + <exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="60"> + </exec_method> + <property_group name="startd" type="framework"> + <!-- sub-process core dumps shouldn't restart session --> + <propval name="ignore_error" type="astring" value="core,signal"/> + </property_group> + <property_group name="general" type="framework"> + <!-- to start stop syslog daemon --> + <propval name="action_authorization" type="astring" value="solaris.smf.manage.system-log"/> + </property_group> + <template> + <common_name> + <loctext xml:lang="C"> + enhanced syslogd + </loctext> + </common_name> + <documentation> + <manpage title="rsyslogd" section="8" manpath="/usr/share/man"/> + </documentation> + </template> + </instance> + <stability value="Unstable"/> + </service> +</service_bundle> diff --git a/debian/smf/method/rsyslog b/debian/smf/method/rsyslog new file mode 100644 index 0000000..96ef0ee --- /dev/null +++ b/debian/smf/method/rsyslog @@ -0,0 +1,25 @@ +#! /bin/sh + +# This script only starts rsyslog +# For stopping use :kill +# For rotating logs use :kill -HUP + +create_xconsole() { + XCONSOLE=/run/xconsole + ln -sf $XCONSOLE /dev/xconsole + if [ ! -e $XCONSOLE ]; then + mknod -m 640 $XCONSOLE p + chown root:adm $XCONSOLE + fi +} + +NAME=rsyslog + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +DAEMON_ARGS="$RSYSLOGD_OPTIONS" + +create_xconsole +exec /usr/sbin/rsyslogd $DAEMON_ARGS + |