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)
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

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:21.0cm 842.0pt;
margin:8.8pt 70.9pt 40.55pt 70.9pt;}
div.Section1
{page:Section1;}
-->
</style>

</head>

<body lang=FR link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Hello all,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>I’m a new user of logsurfer, I’m running
it onto a RHEL3ES linux server.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Here is the output of the redhat init script with a “set
–x” added into it :<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>[root@supervision root]# /etc/init.d/logsurfer start
| more<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ '[' -f /etc/sysconfig/logsurfer ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ LOGSURFER_HOME=/etc/logsurfer<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ LOGSURFER_EXE=/usr/local/bin/logsurfer<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ SYSLOG_FILE=/var/log/secure<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ LOGSURFER_CONFFILE=/etc/logsurfer/logsurfer.conf<o:p></o:p></span></font
></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ LOGSURFER_PIDFILE=/etc/logsurfer/logsurfer.pid<o:p></o:p></span></font><
/p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ LOGSURFER_LOGFILE=/etc/logsurfer/logsurfer.log<o:p></o:p></span></font><
/p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ LOGSURFER_DUMPFILE=/etc/logsurfer/logsurfer.dump<o:p></o:p></span></font
></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ LOGSURFER_ARGS=-c /etc/logsurfer/logsurfer.conf -d
/etc/logsurfer/logsurfer.dump -f -p /etc/logsurfer/logsurfer.pid
/var/log/secure<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ RETVAL=0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ umask 077<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ start<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo -n 'Starting logsurfer: '<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>++ wc -l<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ CURRENT_LOG_POS=   4306<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ 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 &'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ local gotbase= force=<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ local base= user= nice= bg= pid=<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ nicelevel=0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' --user '!=' -user ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ user=root<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ shift 2<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' '/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 &' ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ '[' -z '' ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ base=logsurfer.log 2>&1 &<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' -f /var/run/logsurfer.log '2>&1'
'&.pid' ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>/etc/init.d/logsurfer: line 126: [: too many
arguments<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' -n '' -a -z '' ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ ulimit -S -c 0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' -n '' ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' color = verbose -a -z '' ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' -z root ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ 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 &"'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ '[' 0 -eq 0 ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ success 'Démarrage de logsurfer.log 2>&1 &'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ '[' -z '' ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+ initlog -q -n /etc/init.d/logsurfer -s 'Démarrage de
logsurfer.log 2>&1 &' -e 1<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' color '!=' verbose -a -z '' ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo_success<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' color = color ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo -en '\033[60G'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo -n '[  '<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' color = color ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo -en '\033[0;32m'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo -n OK<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' color = color ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo -en '\033[0;39m'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo -n '  ]'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo -ne '\r'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ return 0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ return 0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ RETVAL=0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ echo<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ '[' 0 -eq 0 ']'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Starting
logsurfer:                                        [  OK  ]<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ touch /var/lock/subsys/logsurfer<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ return 0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>+ exit 0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Any idea of what I missed in order to correct the “:
line 126: [: too many arguments” error message at stop / start of
logsurfer ?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Thanks<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Florent<o:p></o:p></span></font></p>

</div>

</body>

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

[ reply ]


 

Privacy Statement
Copyright 2010, SecurityFocus