Drop --with-syslogd-pidfile from configure, use -P option to syslogd
This patch drops the configure flag --with-syslogd-pidfile=foo since syslogd now natively supports custom PID file using -P foo. Also, the default PID file and syslog.conf paths have been changed from the hard-coded /var/run (_PATH_VARRUN) and /etc to use configure paths. This may not be appreciated by everyone but allows the project to have support for all use-cases in a de facto standard fashion. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
		
							
								
								
									
										18
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								configure.ac
									
									
									
									
									
								
							@@ -54,17 +54,13 @@ AC_ARG_WITH(klogd,
 | 
			
		||||
	[klogd=$withval], [klogd='no'])
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(klogd-delay,
 | 
			
		||||
        AS_HELP_STRING([--with-klogd-delay=SEC], [When klogd is started at the same time as syslogd, default: 0]),
 | 
			
		||||
        AS_HELP_STRING([--with-klogd-delay=SEC], [Delay before klogd connects to syslogd, default: 0]),
 | 
			
		||||
	[klogd_delay=$withval], [klogd_delay='no'])
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(suspend-time,
 | 
			
		||||
        AS_HELP_STRING([--with-suspend-time=SEC], [Retry timeout for remote syslogd servers, default: 180]),
 | 
			
		||||
        AS_HELP_STRING([--with-suspend-time=SEC], [Retry delay for sending to remote, default: 180]),
 | 
			
		||||
	[suspend_time=$withval], [suspend_time='no'])
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(syslogd-pidfile,
 | 
			
		||||
        AS_HELP_STRING([--with-syslogd-pidfile=FILE], [custom PID file, default: syslogd.pid]),
 | 
			
		||||
	[syslogd_pidfile=$withval], [syslogd_pidfile='no'])
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(systemd,
 | 
			
		||||
     [AS_HELP_STRING([--with-systemd=DIR], [Directory for systemd service files])],,
 | 
			
		||||
     [with_systemd=auto])
 | 
			
		||||
@@ -86,16 +82,9 @@ AS_IF([test "x$suspend_time" != "xno"],[
 | 
			
		||||
	AS_IF([test "x$suspend_time" = "xyes"],[
 | 
			
		||||
		AC_MSG_ERROR([Must supply argument])])
 | 
			
		||||
	]
 | 
			
		||||
	AC_DEFINE_UNQUOTED(INET_SUSPEND_TIME, $suspend_time, [Retry timeout for remote syslgod servers, default: 180]),
 | 
			
		||||
	AC_DEFINE_UNQUOTED(INET_SUSPEND_TIME, $suspend_time, [Retry delay for sending to remote syslog servers, default: 180]),
 | 
			
		||||
	suspend_time=180)
 | 
			
		||||
 | 
			
		||||
AS_IF([test "x$syslogd_pidfile" != "xno"],[
 | 
			
		||||
	AS_IF([test "x$syslogd_pidfile" = "xyes"],[
 | 
			
		||||
		AC_MSG_ERROR([Must supply argument])])
 | 
			
		||||
	]
 | 
			
		||||
	AC_DEFINE_UNQUOTED(SYSLOGD_PIDNAME, "$syslogd_pidfile", [Custom syslogd PID file]),
 | 
			
		||||
	syslogd_pidfile="syslogd.pid")
 | 
			
		||||
 | 
			
		||||
# Check where to install the systemd .service file
 | 
			
		||||
AS_IF([test "x$with_systemd" = "xyes" -o "x$with_systemd" = "xauto"], [
 | 
			
		||||
     def_systemd=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
 | 
			
		||||
@@ -132,7 +121,6 @@ cat <<EOF
 | 
			
		||||
  klogd..........: $with_klogd
 | 
			
		||||
  klogd delay....: $klogd_delay sec
 | 
			
		||||
  suspend time...: $suspend_time sec
 | 
			
		||||
  pid file.......: /var/run/$syslogd_pidfile
 | 
			
		||||
  systemd........: $with_systemd
 | 
			
		||||
 | 
			
		||||
------------- Compiler version --------------
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@
 | 
			
		||||
 | 
			
		||||
static struct syslog_data log = SYSLOG_DATA_INIT;
 | 
			
		||||
 | 
			
		||||
static char *PidFile = _PATH_VARRUN "klogd.pid";
 | 
			
		||||
static char *PidFile = LOCALSTATEDIR "/run/klogd.pid";
 | 
			
		||||
 | 
			
		||||
static int kmsg;
 | 
			
		||||
static int change_state      = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -68,16 +68,11 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef _PATH_LOGCONF
 | 
			
		||||
#define _PATH_LOGCONF  "/etc/syslog.conf"
 | 
			
		||||
#define _PATH_LOGCONF  SYSCONFDIR "/syslog.conf"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(SYSLOGD_PIDNAME)
 | 
			
		||||
#undef _PATH_LOGPID
 | 
			
		||||
#define _PATH_LOGPID _PATH_VARRUN SYSLOGD_PIDNAME
 | 
			
		||||
#else
 | 
			
		||||
#ifndef _PATH_LOGPID
 | 
			
		||||
#define _PATH_LOGPID _PATH_VARRUN "syslogd.pid"
 | 
			
		||||
#endif
 | 
			
		||||
#define _PATH_LOGPID LOCALSTATEDIR "/run/syslogd.pid"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef _PATH_DEV
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user