Prepend the short hostname to the log line to have a compliant syslog(3)

entry allowing remote logging based on the host.
This commit is contained in:
ajacoutot 2012-05-29 10:21:56 +00:00
parent 21c62fa466
commit 38c839f00b
3 changed files with 34 additions and 10 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.10 2012/03/20 16:36:16 naddy Exp $
# $OpenBSD: Makefile,v 1.11 2012/05/29 10:21:56 ajacoutot Exp $
COMMENT= simple backup tool -- common files
PKGNAME= backintime-common-${V}
REVISION= 2
REVISION= 3
WRKSRC= ${WRKDIST}/common
@ -13,8 +13,4 @@ RUN_DEPENDS= sysutils/coreutils \
SUBST_FILES= backintime config.py
# XXX
post-patch:
perl -pi -e 's,1.0.7,1.0.8,g' ${WRKSRC}/config.py
.include <bsd.port.mk>

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-common_config_py,v 1.3 2011/03/03 13:49:27 ajacoutot Exp $
--- common/config.py.orig Sun Jan 2 15:03:07 2011
+++ common/config.py Mon Feb 21 19:14:16 2011
@@ -29,7 +29,7 @@ import logger
$OpenBSD: patch-common_config_py,v 1.4 2012/05/29 10:21:56 ajacoutot Exp $
--- common/config.py.orig Wed Jan 5 21:08:29 2011
+++ common/config.py Tue May 29 12:20:17 2012
@@ -29,13 +29,13 @@ import logger
_=gettext.gettext
@ -10,6 +10,13 @@ $OpenBSD: patch-common_config_py,v 1.3 2011/03/03 13:49:27 ajacoutot Exp $
gettext.textdomain( 'backintime' )
class Config( configfile.ConfigFileWithProfiles ):
APP_NAME = 'Back In Time'
- VERSION = '1.0.7'
+ VERSION = '1.0.8'
COPYRIGHT = 'Copyright (c) 2008-2009 Oprea Dan, Bart de Koning, Richard Bailey'
CONFIG_VERSION = 5
@@ -77,11 +77,11 @@ class Config( configfile.ConfigFileWithProfiles ):
configfile.ConfigFileWithProfiles.__init__( self, _('Main profile') )

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-common_logger_py,v 1.1 2012/05/29 10:21:56 ajacoutot Exp $
Prepend the short hostname to the log line to have a compliant syslog(3)
entry allowing remote logging based on the hostname.
--- common/logger.py.orig Tue May 29 12:14:41 2012
+++ common/logger.py Tue May 29 12:18:58 2012
@@ -18,10 +18,12 @@
import syslog
import os
+import socket
def openlog():
name = os.getenv( 'LOGNAME', 'unknown' )
- syslog.openlog( "backintime (%s)" % name )
+ host = socket.gethostname().split('.')[0]
+ syslog.openlog( "%s backintime (%s)" % ( host, name ) )
def closelog():
syslog.closelog()