summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog18
-rw-r--r--debian/control3
-rw-r--r--debian/patches/dyson-imsolaris-no-libdoor.patch11
-rw-r--r--debian/patches/dyson-imuxsock.patch13
-rw-r--r--debian/patches/series2
-rw-r--r--debian/rsyslog.conf1
-rw-r--r--debian/rsyslog.install1
-rw-r--r--debian/rsyslog.logrotate12
-rw-r--r--debian/rsyslog.postinst.smf17
-rw-r--r--debian/rsyslog.prerm.smf11
-rwxr-xr-xdebian/rules21
-rw-r--r--debian/smf/manifest/system/rsyslog.xml51
-rw-r--r--debian/smf/method/rsyslog25
13 files changed, 180 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 1052b35..2165323 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+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 b4bfe1d..5461373 100644
--- a/debian/control
+++ b/debian/control
@@ -27,6 +27,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,
@@ -34,7 +35,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 2113a56..abf808c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
# Debian patches for rsyslog
+dyson-imuxsock.patch
01-dont_create_db.patch
+dyson-imsolaris-no-libdoor.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 07b6e7e..a94fc1d 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..01a85ad
--- /dev/null
+++ b/debian/rsyslog.postinst.smf
@@ -0,0 +1,17 @@
+
+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;;
+ esac
+fi
+
diff --git a/debian/rsyslog.prerm.smf b/debian/rsyslog.prerm.smf
new file mode 100644
index 0000000..081e739
--- /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 $fmri || true;;
+ esac
+ ;;
+esac
+
diff --git a/debian/rules b/debian/rules
index 2616c8c..9e03c84 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,9 +13,13 @@ confflags += --enable-imptcp \
--enable-kmsg
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 \
@@ -38,6 +42,7 @@ override_dh_auto_configure:
--enable-mmjsonparse \
--disable-libgcrypt \
--disable-testbench \
+ $(confflags) \
--with-systemdsystemunitdir=/lib/systemd/system
override_dh_auto_install:
@@ -55,6 +60,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_compress:
dh_compress -X rsyslog-example.conf
diff --git a/debian/smf/manifest/system/rsyslog.xml b/debian/smf/manifest/system/rsyslog.xml
new file mode 100644
index 0000000..7fb8b59
--- /dev/null
+++ b/debian/smf/manifest/system/rsyslog.xml
@@ -0,0 +1,51 @@
+<?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="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
+