NSLU2-Linux
view · edit · print · history

TurnupMemstickSyslog, How to use the syslog with "turnup memstick"

Back to HowTo

If you want to use your NSLU2 with SlugOS/BE and a Memstick only as mass storage, the turnup script for setting up your operating system configures syslog to use a RAM-buffer instead of the file system (/var/log/messages). Please see /etc/syslog.conf DESTINATION="buffer". The commands to use syslog are in the busybox.
According to the help busybox syslogd -h it means that this version of syslogd ignores /etc/syslog.conf. Instead the file /etc/syslog.conf is used by the startup script /etc/init.d/syslog. If the parameter DESTINATION is = "buffer", then the parameter LOGFILE is not used. If you want to make changes, e.g. set MARKINT (MARK interval in minutes) from 20 to 60 minutes, make the change in /etc/syslog.conf and type as root: /etc/init.d/syslog stop; /etc/init.d/syslog start. With ps you can see which parameters are used:

/sbin/syslogd -n -C 64 -m 20
-n means Run as a foreground process
-C 64 means Log to a circular buffer (read the buffer using logread) (64 KB)
-m 20 means Minutes between MARK lines (default=20, 0=off)\\

 Legend: ">" means user shell, "$" means root shell
 > logname      # Print the name of the current user.
 > logger test  # puts the text "test" in syslog
 $ logread      # read out syslog (normal /var/log/messages)
 Jan  4 08:23:19 (none) user.notice rudi: test
 $ logread -f   # show the syslog input instant until you hit CTRL C

If you want to use syslog from Python:
import syslog
syslog.syslog("test2")
logread: Jan 4 08:31:45 (none) user.info python: test2

For example, if you want to log if Python is running type:

  > ps | grep python 2>&1 | logger
and you get with $ logread -f:
Jan 5 14:01:30 (none) user.notice rudi: 3492 rudi 11636 S python moin server standalone --start
Jan 5 14:01:30 (none) user.notice rudi: 10044 rudi 568 S grep moin\\

2009-01-05 RudolfReuter

view · edit · print · history · Last edited by RudolfReuter.
Originally by RudolfReuter.
Page last modified on January 20, 2009, at 06:41 AM