Coupla bugs ? syslogd -C, logger, losetup
Denys Vlasenko
vda.linux at googlemail.com
Tue Oct 2 09:55:39 UTC 2007
On Monday 01 October 2007 20:54, Mike wrote:
> Howdy,
>
> syslogd option paramater -C is not recognised in 1.7.1.
>
> I poked around and the culprit appears to be an extra semicolon in
> the options parameter declaration for it. This trivial patch seems to do
> the trick for me (compiled + tested minimally).
>
>
> diff -ur busybox-1.7.1.orig/sysklogd/syslogd.c
> busybox-1.7.1/sysklogd/syslogd.c
> --- busybox-1.7.1.orig/sysklogd/syslogd.c 2007-09-03
> 11:48:35.000000000 +0000
> +++ busybox-1.7.1/sysklogd/syslogd.c 2007-09-29 16:53:12.000000000 +0000
> @@ -159,7 +159,7 @@
> USE_FEATURE_ROTATE_LOGFILE("b:" ) \
> USE_FEATURE_REMOTE_LOG( "R:" ) \
> USE_FEATURE_REMOTE_LOG( "L" ) \
> - USE_FEATURE_IPC_SYSLOG( "C::")
> + USE_FEATURE_IPC_SYSLOG( "C:")
> #define OPTION_DECL *opt_m, *opt_l \
> USE_FEATURE_ROTATE_LOGFILE(,*opt_s) \
> USE_FEATURE_ROTATE_LOGFILE(,*opt_b) \
Double :: means that the parameter is optional.
In this case, you _must_ specify parameter without space:
Ok: busybox syslogd -n -C8
Bad: busybox syslogd -n -C 8
Help text is showing this for you:
$ busybox syslogd --help
BusyBox v1.8.0.svn (2007-10-01 13:07:24 IST) multi-call binary
Usage: syslogd [OPTION]...
System logging utility.
Note that this version of syslogd ignores /etc/syslog.conf.
Options:
-n Run in foreground
-O FILE Log to given file (default=/var/log/messages)
-l n Set local log level
-S Smaller logging output
-s SIZE Max size (KB) before rotate (default=200KB, 0=off)
-b NUM Number of rotated logs to keep (default=1, max=99, 0=purge)
-R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP)
-L Log locally and via network (default is network only if -R)
-C[size(KiB)] Log to shared mem buffer (read it using logread)
^^^ no space!
> Also, losetup seems to not be working correctly and I can't seem to get
> it to work with my compressed loop device /dev/cloop/[0-7]. It looks
> like a flub with parsing argv but I ran out of time looking at it.
You need to do better than that. At least specify what
sequence of commands doesn't work.
For me, the following works:
# dd if=/dev/zero bs=1M count=32 >/tmp/image
32+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 0.091392 seconds, 367 MB/s
# mke2fs /tmp/image
mke2fs 1.38 (30-Jun-2005)
image is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
8192 inodes, 32768 blocks
1638 blocks (5.00%) reserved for the super user
First data block=1
4 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
8193, 24577
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# busybox losetup /dev/loop/0 /tmp/image
# mount /dev/loop/0 /mnt/tmp
# ls -l /mnt/tmp
drwx------ 2 root root 12288 Oct 2 10:50 lost+found
> ALSO, I just noticed, logger seems to only take the first argument on
> the command like for squirting into syslog. eg:
>
> logger this is a test
>
> will only put 'this' into syslog and omit the rest. Past behaviour was
> to stuff everything into syslog. I can work around it by enclosing stuff
> in quotes but the previous behavior, I think, is more desireable.
Fixed, thanks.
--
vda
More information about the busybox
mailing list