Skip to contentSkip to conversation

rsyslog: remove pointless umask from sysv initscript

PATCH New Gustavo Zacarias 2 participants 6 messages Jan 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rsyslog: remove pointless umask from sysv initscript

---
 package/rsyslog/S01logging | 1 -
 1 file changed, 1 deletion(-)
package/rsyslog/S01logging +0 -1
index 97d519a..6471676 100644
@@ -2,7 +2,6 @@
 
 start() {
   echo -n "Starting rsyslog daemon: "
-  umask 077
   start-stop-daemon -S -q -p /var/run/rsyslogd.pid --exec /usr/sbin/rsyslogd
   [ $? = 0 ] && echo "OK" || echo "FAIL"
 }
Signature · 1 line
2.0.5
#1 lore raw

PATCH 2/2 rsyslog: enable sql support

Enable support for mysql and pgsql.
Patches sent upstream (pull request on github).

---
 ...make-mysql-support-cross-compile-friendly.patch | 53 ++++++++++++++++++++++
 ...make-pgsql-support-cross-compile-friendly.patch | 53 ++++++++++++++++++++++
 package/rsyslog/rsyslog.mk                         | 14 ++++++
 3 files changed, 120 insertions(+)
 create mode 100644 package/rsyslog/0001-configure.ac-make-mysql-support-cross-compile-friendly.patch
 create mode 100644 package/rsyslog/0002-configure.ac-make-pgsql-support-cross-compile-friendly.patch
package/rsyslog/0001-configure.ac-make-mysql-support-cross-compile-friendly.patch new file +53 -0
new file mode 100644
index 0000000..74a144d
@@ -0,0 +1,53 @@
+From b095b56b7cf96a5b1a5e411b6da14b5e9f237a43 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <[email protected]>
+Date: Wed, 14 Jan 2015 10:07:50 -0300
+Subject: [PATCH] configure.ac: make mysql support cross-compile friendly
+
+When cross-compiling mysql_config shouldn't be expected to be in PATH
+since normally this would point to distribution mysql rather than cross,
+which can be of a totally different architecture.
+
+Change it so we can use ac_cv_prog_MYSQL_CONFIG to point to the real one.
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+---
+ configure.ac | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ad7274c..4e662dc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -547,21 +547,22 @@ AC_ARG_ENABLE(mysql,
+ )
+ if test "x$enable_mysql" = "xyes"; then
+   AC_CHECK_PROG(
+-    [HAVE_MYSQL_CONFIG],
++    [MYSQL_CONFIG],
+     [mysql_config],
+-    [yes],,,
++    [mysql_config],
++    [no],,
+   )
+-  if test "x${HAVE_MYSQL_CONFIG}" != "xyes"; then
+-    AC_MSG_FAILURE([mysql_config not found in PATH - usually a package named mysql-dev, libmysql-dev or similar, is missing - install it to fix this issue])
++  if test "x${MYSQL_CONFIG}" = "xno"; then
++    AC_MSG_FAILURE([mysql_config not found - usually a package named mysql-dev, libmysql-dev or similar, is missing - install it to fix this issue])
+   fi
+   AC_CHECK_LIB(
+     [mysqlclient],
+     [mysql_init],
+-    [MYSQL_CFLAGS=`mysql_config --cflags`
+-     MYSQL_LIBS=`mysql_config --libs`
++    [MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
++     MYSQL_LIBS=`$MYSQL_CONFIG --libs`
+     ],
+     [AC_MSG_FAILURE([MySQL library is missing])],
+-    [`mysql_config --libs`]
++    [`$MYSQL_CONFIG --libs`]
+   )
+   AC_MSG_CHECKING(if we have mysql_library_init)
+   save_CFLAGS="$CFLAGS"
+-- 
+2.0.5
+
package/rsyslog/0002-configure.ac-make-pgsql-support-cross-compile-friendly.patch new file +53 -0

53 lines not on this page · raw message

package/rsyslog/rsyslog.mk +14 -0
index a45111d..39d5637 100644
@@ -16,6 +16,8 @@ RSYSLOG_PLUGINS = imdiag imfile impstats imptcp \
 	pmaixforwardedfrom pmciscoios pmcisconames pmlastmsg pmsnare
 RSYSLOG_CONF_OPTS = --disable-generate-man-pages \
 	$(foreach x,$(call qstrip,$(RSYSLOG_PLUGINS)),--enable-$(x))
+# For mysql and pgsql support patches
+RSYSLOG_AUTORECONF = YES
 
 # Build after BusyBox
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
@@ -34,6 +36,18 @@ else
 	RSYSLOG_CONF_OPTS += --enable-libgcrypt=no
 endif
 
+ifeq ($(BR2_PACKAGE_MYSQL),y)
+	RSYSLOG_DEPENDENCIES += mysql
+	RSYSLOG_CONF_OPTS += --enable-mysql
+	RSYSLOG_CONF_ENV += ac_cv_prog_MYSQL_CONFIG=$(STAGING_DIR)/usr/bin/mysql_config
+endif
+
+ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
+	RSYSLOG_DEPENDENCIES += postgresql
+	RSYSLOG_CONF_OPTS += --enable-pgsql
+	RSYSLOG_CONF_ENV += ac_cv_prog_PG_CONFIG=$(STAGING_DIR)/usr/bin/pg_config
+endif
+
 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
 	RSYSLOG_DEPENDENCIES += util-linux
 	RSYSLOG_CONF_OPTS += --enable-uuid
Signature · 1 line
2.0.5
#2 lore raw

PATCH 1/2 rsyslog: remove pointless umask from sysv initscript

In reply to Gustavo Zacarias

Dear Gustavo Zacarias,

Quoted 4 lines · Gustavo Zacarias
---
 package/rsyslog/S01logging | 1 -
 1 file changed, 1 deletion(-)

Thanks, both patches applied. I've added 3 more patches on top to do some further minor cleanup/improvements in rsyslog.mk.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/2 rsyslog: remove pointless umask from sysv initscript

Quoted 2 lines · Thomas Petazzoni

Thanks, both patches applied. I've added 3 more patches on top to do some further minor cleanup/improvements in rsyslog.mk.

The explicit disable is a bit redundant since most rsyslog options are default off but upstream can always change that and silently break things on bumps on the other hand.
Regards.

#4 lore raw

PATCH 1/2 rsyslog: remove pointless umask from sysv initscript

Dear Gustavo Zacarias,

Quoted 6 lines · Gustavo Zacarias
Quoted 2 lines

Thanks, both patches applied. I've added 3 more patches on top to do some further minor cleanup/improvements in rsyslog.mk.

The explicit disable is a bit redundant since most rsyslog options are default off but upstream can always change that and silently break things on bumps on the other hand.

Well, we already had an explicit disable for libgcrypt, and for most packages, we try to make the disable explicit anyway, so I simply erred on the safe side here.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/2 rsyslog: remove pointless umask from sysv initscript

Quoted 3 lines · Thomas Petazzoni

Well, we already had an explicit disable for libgcrypt, and for most packages, we try to make the disable explicit anyway, so I simply erred on the safe side here.

rsyslog has many more options that we don't handle, but i'll leave it as is, i think the reasonable use cases a covered :)
Someone else feel free to add more bloa^H^H^H^Hoptions! Regards.