Patchwork [base,13/13] rsyslog: add flag to set log file name

login
register
mail settings
Submitter Jacob Kjaergaard
Date Sept. 30, 2013, 8:25 a.m.
Message ID <cae47aa981202b722dc4982212e8dff3007a00d2.1380529272.git.jacob.kjaergaard@prevas.dk>
Download mbox | patch
Permalink /patch/278962/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

Jacob Kjaergaard - Sept. 30, 2013, 8:25 a.m.
From: Jacob Kjaergaard <jacob.kjaergaard@prevas.dk>

---
 recipes/rsyslog/rsyslog.inc |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Esben Haabendal - Oct. 14, 2013, 1:35 p.m.
<jabk@prevas.dk> writes:

> From: Jacob Kjaergaard <jacob.kjaergaard@prevas.dk>
>
> ---
>  recipes/rsyslog/rsyslog.inc |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/recipes/rsyslog/rsyslog.inc b/recipes/rsyslog/rsyslog.inc
> index e51311a..76d4d23 100644
> --- a/recipes/rsyslog/rsyslog.inc
> +++ b/recipes/rsyslog/rsyslog.inc
> @@ -12,17 +12,23 @@ SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${PN}-${PV}.tar.gz \
>            file://rsyslog"
>  
>  inherit autotools-autoreconf sysvinit
> -RECIPE_FLAGS = "rsyslog_sysvinit_start rsyslog_log_dir"
> +RECIPE_FLAGS = "rsyslog_sysvinit_start rsyslog_log_dir rsyslog_log_name"

I changed the flag name to USE_rsyslog_logfile, to better indicate that
it is the log file (name), and not just a name.

>  DEFAULT_USE_rsyslog_sysvinit_start = "20"
>  DEFAULT_USE_rsyslog_log_dir = ""
> +DEFAULT_USE_rsyslog_log_name = "messages"
>  do_install[postfuncs] =+ "do_install_conf"
>  do_install_conf() {
>  	sysvinit_install_script ${SRCDIR}/${PN}
>  
> +	if [ -n "${USE_rsyslog_log_name}" ]; then	
> +	  sed 's#/var/log/messages#/var/log/${USE_rsyslog_log_name}#' -i ${SRCDIR}/rsyslog.conf
> +	fi
> +
>  	if [ -n "${USE_rsyslog_log_dir}" ]; then	
>  	  sed 's#/var/log#${USE_rsyslog_log_dir}#' -i ${SRCDIR}/rsyslog.conf
>  	fi
>  
> +
>  	install ${SRCDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
>  }
>  

I had to merge it with my changes to rsyslog.inc, but have pushed the
resulting commit to master branch.

/Esben

Patch

diff --git a/recipes/rsyslog/rsyslog.inc b/recipes/rsyslog/rsyslog.inc
index e51311a..76d4d23 100644
--- a/recipes/rsyslog/rsyslog.inc
+++ b/recipes/rsyslog/rsyslog.inc
@@ -12,17 +12,23 @@  SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${PN}-${PV}.tar.gz \
           file://rsyslog"
 
 inherit autotools-autoreconf sysvinit
-RECIPE_FLAGS = "rsyslog_sysvinit_start rsyslog_log_dir"
+RECIPE_FLAGS = "rsyslog_sysvinit_start rsyslog_log_dir rsyslog_log_name"
 DEFAULT_USE_rsyslog_sysvinit_start = "20"
 DEFAULT_USE_rsyslog_log_dir = ""
+DEFAULT_USE_rsyslog_log_name = "messages"
 do_install[postfuncs] =+ "do_install_conf"
 do_install_conf() {
 	sysvinit_install_script ${SRCDIR}/${PN}
 
+	if [ -n "${USE_rsyslog_log_name}" ]; then	
+	  sed 's#/var/log/messages#/var/log/${USE_rsyslog_log_name}#' -i ${SRCDIR}/rsyslog.conf
+	fi
+
 	if [ -n "${USE_rsyslog_log_dir}" ]; then	
 	  sed 's#/var/log#${USE_rsyslog_log_dir}#' -i ${SRCDIR}/rsyslog.conf
 	fi
 
+
 	install ${SRCDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
 }