WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Remote syslog feeding  (Read 2252 times)

Offline Ivan Susanin

  • Newbie
  • *
  • Posts: 3
Remote syslog feeding
« on: February 18, 2012, 06:43:25 AM »
Hello,

Firstly, let me thank to creators and developers of this cool distro - guys, you doing it right! It is very impressive! I'm take off my hat  8)

Recently, I was missing one vital (for me) feature - feeding logs to remote syslog server. So, this trivial patch add it.

Quote
--- original/etc/init.d/tc-config   2012-02-18 13:33:52.095095448 +0200
+++ core-dev/etc/init.d/tc-config   2012-02-12 21:29:20.845575273 +0200
@@ -65,6 +65,7 @@
             mydata* ) MYDATA=${i#*=} ;;
             pretce* ) PRETCE=${i#*=} ;;
             xvesa* ) XVESA=${i#*=} ;;
+            rsyslog=* ) RSYSLOG=${i#*=}; SYSLOG=1 ;;
             blacklist* ) BLACKLIST="$BLACKLIST ${i#*=}" ;;
          esac
       ;;
@@ -156,7 +157,8 @@
 fi
 
 if [ -n "$SYSLOG" ]; then
-    /sbin/syslogd && echo "${GREEN}syslog started.${NORMAL}"
+   [ -z "$RSYSLOG" ] || SOPTS=" -L -R $RSYSLOG "
+    /sbin/syslogd ${SOPTS} && echo "${GREEN}syslog started.${NORMAL}"
     /sbin/klogd && echo "${GREEN}klog started."
 fi
 

To enable - append to options "rsyslog=ip.of.syslog.srv"

I would be very happy if this fix get's into Core some day!

Thank you,
Ivan

« Last Edit: February 18, 2012, 06:50:06 AM by susanin »
Follow me! ;)))

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Remote syslog feeding
« Reply #1 on: February 18, 2012, 07:23:40 AM »
Looks good to me. Nice for a first patch :)
The only barriers that can stop you are the ones you create yourself.

Offline Ivan Susanin

  • Newbie
  • *
  • Posts: 3
Re: Remote syslog feeding
« Reply #2 on: February 18, 2012, 07:33:58 AM »
Thanks :)

Also, to follow your global coding style, RSYSLOG magic can be rewritten as:

Quote
[ -n "$RSYSLOG" ] && SOPTS=" -L -R $RSYSLOG "

Thanks,
Ivan
Follow me! ;)))

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Remote syslog feeding
« Reply #3 on: February 18, 2012, 02:31:58 PM »
Patch accepted. Look for this in 4.4
10+ Years Contributing to Linux Open Source Projects.