LogAnalysis
[logs] Error message with init script for redhat : ": line 126: [:too many arguments" Sep 29 2007 03:27PM
Florent Gilain (florent gilain direct-energie com) (1 replies)
Re: [logs] Error message with init script for redhat : ": line 126: [: too many arguments" Oct 01 2007 04:15AM
Kerry Thompson (kerry crypt gen nz)

The logsurfer init script has an error in it. About line 125 it has:

base=logsurfer.log 2>&1 &

... which I think should be just

base=logsurfer.log

If you send me a copy of the /etc/init.d/logsurfer script (no need to send
it to the Loganalysis group) I could have a closer look at it.

Kerry

Florent Gilain said:
> Hello all,
>
>
>
> I?m a new user of logsurfer, I?m running it onto a RHEL3ES linux server.
>
>
>
> Here is the output of the redhat init script with a ?set ?x? added into it
> :
>
>
>
> [root@supervision root]# /etc/init.d/logsurfer start | more
>
> + '[' -f /etc/sysconfig/logsurfer ']'
>
> + LOGSURFER_HOME=/etc/logsurfer
>
> + LOGSURFER_EXE=/usr/local/bin/logsurfer
>
> + SYSLOG_FILE=/var/log/secure
>
> + LOGSURFER_CONFFILE=/etc/logsurfer/logsurfer.conf
>
> + LOGSURFER_PIDFILE=/etc/logsurfer/logsurfer.pid
>
> + LOGSURFER_LOGFILE=/etc/logsurfer/logsurfer.log
>
> + LOGSURFER_DUMPFILE=/etc/logsurfer/logsurfer.dump
>
> + LOGSURFER_ARGS=-c /etc/logsurfer/logsurfer.conf -d
> /etc/logsurfer/logsurfer.dump -f -p /etc/logsurfer/logsurfer.pid
> /var/log/secure
>
> + RETVAL=0
>
> + umask 077
>
> + start
>
> + echo -n 'Starting logsurfer: '
>
> ++ wc -l
>
> + CURRENT_LOG_POS= 4306
>
> + daemon --user root '/usr/local/bin/logsurfer -l 4306 -c
> /etc/logsurfer/logsurfer.conf -d /etc/logsurfer/logsurfer.dump -f -p
> /etc/logsurfer/logsurfer.pid /var/log/secure >/etc/logsurfer/logsurfer.log
> 2>&1 &'
>
> + local gotbase= force
> + local base= user= nice= bg= pid
> + nicelevel=0
>
> + '[' --user '!=' -user ']'
>
> + user=root
>
> + shift 2
>
> + '[' '/usr/local/bin/logsurfer -l 4306 -c
> /etc/logsurfer/logsurfer.conf
> -d /etc/logsurfer/logsurfer.dump -f -p /etc/logsurfer/logsurfer.pid
> /var/log/secure >/etc/logsurfer/logsurfer.log 2>&1 &' '!='
> '/usr/local/bin/logsurfer -l 4306 -c /etc/logsurfer/logsurfer.conf -d
> /etc/logsurfer/logsurfer.dump -f -p /etc/logsurfer/logsurfer.pid
> /var/log/secure >/etc/logsurfer/logsurfer.log 2>&1 &' ']'
>
> + '[' -z '' ']'
>
> + base=logsurfer.log 2>&1 &
>
> + '[' -f /var/run/logsurfer.log '2>&1' '&.pid' ']'
>
> /etc/init.d/logsurfer: line 126: [: too many arguments
>
> + '[' -n '' -a -z '' ']'
>
> + ulimit -S -c 0
>
> + '[' -n '' ']'
>
> + '[' color = verbose -a -z '' ']'
>
> + '[' -z root ']'
>
> + initlog -q -c 'su -s /bin/bash - root -c "/usr/local/bin/logsurfer -l
> 4306 -c /etc/logsurfer/logsurfer.conf -d /etc/logsurfer/logsurfer.dump -f
> -p
> /etc/logsurfer/logsurfer.pid /var/log/secure >/etc/logsurfer/logsurfer.log
> 2>&1 &"'
>
> + '[' 0 -eq 0 ']'
>
> + success 'Démarrage de logsurfer.log 2>&1 &'
>
> + '[' -z '' ']'
>
> + initlog -q -n /etc/init.d/logsurfer -s 'Démarrage de logsurfer.log 2>&1
> &' -e 1
>
> + '[' color '!=' verbose -a -z '' ']'
>
> + echo_success
>
> + '[' color = color ']'
>
> + echo -en '\033[60G'
>
> + echo -n '[ '
>
> + '[' color = color ']'
>
> + echo -en '\033[0;32m'
>
> + echo -n OK
>
> + '[' color = color ']'
>
> + echo -en '\033[0;39m'
>
> + echo -n ' ]'
>
> + echo -ne '\r'
>
> + return 0
>
> + return 0
>
> + RETVAL=0
>
> + echo
>
> + '[' 0 -eq 0 ']'
>
> Starting logsurfer: [ OK ]
>
> + touch /var/lock/subsys/logsurfer
>
> + return 0
>
> + exit 0
>
>
>
>
>
> Any idea of what I missed in order to correct the ?: line 126: [: too many
> arguments? error message at stop / start of logsurfer ?
>
>
>
> Thanks
>
>
>
> Florent
>
> _______________________________________________
> LogAnalysis mailing list
> LogAnalysis (at) loganalysis (dot) org [email concealed]
> http://www.loganalysis.org/mailman/listinfo/loganalysis

_______________________________________________
LogAnalysis mailing list
LogAnalysis (at) loganalysis (dot) org [email concealed]
http://www.loganalysis.org/mailman/listinfo/loganalysis

[ reply ]


 

Privacy Statement
Copyright 2010, SecurityFocus