Solved

unary operator expected

Posted on 2000-03-07
14
1,134 Views
Last Modified: 2013-12-15
   I just bought and installed Linux-Mandrake 7.0. The install went fine except I set up the network during install, but none of the settings took, and I had to set it all up later. Now when I boot up I keep getting these assorted messages:
/etc/rc.d/rc5.d/S50network [. [= unary operator expected
    I get this for the /etc/rc.d/rc5.d S**postfix, S**rwhod, S**userd, S**bootparm (**=moves to fast for me to see on boot up)and many others. When I check the /var/log/boot.log I only see the "/etc/rc.d/rc5.d/S30postfix [. [= unary operator expected" message. I don't know much about programming, so I would have no clue what is wrong by looking at the script. Its not just rc5.d, but also /etc/rc.d/rc0.d/ through /etc/rc.d/rc6.d/ (It appears to boot with different ones each time).
    Everything seems to be working GREAT. No problems at all, Just these messages everytime I boot up.
    This is installed on a machine with a Pentium Pro 200 MHZ, 64MB Ram, a 3com combo card, ANything else I could anwser if needed.
0
Comment
Question by:SeanD
  • 5
  • 4
  • 4
  • +1
14 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2593989
The "unary operator expected" is the shell saying that it doesn't understand somethhin in the rc?.d files. It just shouldn't happen. It's also odd that the networking set up "didn't take" during the install. My suspicion based on the description is that the install didn't properly complete.

Which model 3com combo have you got?
0
 

Author Comment

by:SeanD
ID: 2594151
I have a 3Com Etherlink III 3C590. The install went through completely. Right down to "Please remove the floppy disk and press OK to restart" or something like that. Everything works fine like I said. The network is working perfectly.
By the way, this is a gateway machine, I'm using it for a Samba server, and IP Masq server, If that makes a difference.
Even though I get these messages, EVERYTHING gets an [ OK ] when booting. Everything is working perfectly.
Sean
0
 
LVL 3

Expert Comment

by:jyu_88
ID: 2594579
you  should be able scroll back by shift +pageUp.

It mainly be caused by a comparison test against a variable, which is NULL or empty for some reason. In shell, it supposed has something like,
[ $VIPvariable = "OK" ] && echo "OK"
However, with $VIPvariable be null, this statement becomes
[ = "OK" ]
.. This will result in complaints you saw.

If you can page up find some  line numbers then you can probably look up in the script and find out which varible is not defined while it is supposed and whatnot.
0
 

Author Comment

by:SeanD
ID: 2596959
I was at work last night and writing this message from memory, and am not sure that this makes a difference, but the exact messages are like this:    
"/etc/rc.d/rc5.d/S50network [: =: unary operator expected"
and not like this:    
"/etc/rc.d/rc5.d/S50network [. [= unary operator expected"
Also I get the same mesage when I restart samba, but it gives the OK
"/etc/sbin/samba [: =: unary operator expected
/etc/sbin/samba [: =: unary operator expected
Shutting down SMB services: [OK]
Shutting down NMB services: [OK]
/etc/sbin/samba [: =: unary operator expected
Starting SMB services: [OK]
Starting SMB services: [OK]"
but like I said, everything seems OK. I will have to take a look at those lines.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 2597452
Just as a guess, I'll bet that the error is being caused by substitution of one of the items that should be in /etc/sysconfig/network aren't there. It should something look like:

NETWORKING=yes
FORWARD_IPV4=false
HOSTNAME="localhost.localdomain"
GATEWAY=

The first three matter the most, and each should have a value.
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2598375
Those error messages come from several of the network related scripts in /etc/rc.d/init.d. Just to make them better scripts you could change the line (if any)

[ ${NETWORKING} = "no" ] && exit 0

to

[ "${NETWORKING}" = "no" ] && exit 0

Your real problem probabely is that the NETWORKING variable in /etc/sysconfig/network has no value assigned, or is not present at all. Make sure the line

NETWORKING=yes

is there.
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2598387
Oh, and indeed, if you didn't want "NETWORKING=no" nothing was wrong with the machine, since the scripts always executed.

0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:SeanD
ID: 2598730
I found the suggestion about
[ ${NETWORKING} = "no" ] && exit 0
in a newsgroup last week and tried it, and nothing changed. As soon as I get a chance (I'm working now) I'll check the /etc/sysconfig/network. I know that when the network configuration didn't work on the install that I edited some of this file myself, it is very likely that I missed something there. I won't get a chance till tomarrow afternoon though, so I'll let you all know then.
Thanx
Sean
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2600097
If adding the " " to
[ ${NETWORKING} = "no" ] && exit 0
didn't work you probabely have some other scripts that cause the same error. All network related scripts in /etc/rc.d/init.d have this same line.

But define NETWORKING=yes and your problems will be over.
0
 

Author Comment

by:SeanD
ID: 2601627
OK I checked out the /ets/sysconfig/network and found uot that there was no line
NETWORKING="yes"
so I added it. When I rebooted I stopped getting the unary operator expected message, but now i get 2 of these lines like this:
Bringing up interface lo    [OK]
Bringing up interface eth0  [OK]
Bringing up interface lo    [OK]
Bringing up interface eth0  [OK]
>other stuff
>
>
Starting portmapper         [OK]
Starting portmapper         [OK]
>
>
Starting postfix            [OK]
Starting postfix            [OK]    
>
>
Like I said, no more unary messages, and everything is working OK, maybe networking is being started somewhere else?
I will except the answer from jlevie, but just wanted to know about this. Should I make this another question? Is this alright to just leave alone?
Thanx
Sean
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2601725
Personally, I'd want to know why that's happening, because it should be. My guess is that it sees two definitions for eth0 (they may both be the same). Normal behaviour is to loop through all the interfaces and bring them all up. Since the system doen't check to see if the second interface is really the same as the first one...

Have you looked at the network config via linuxconf? Since it manipulates the same data you might see more than one "Adapter" defined and can delete the second. Also it may emit a n error that would help pin down the problem.
0
 
LVL 2

Expert Comment

by:Reinier
ID: 2601817
Did you change anything to /etc/syslog.conf? To be precise are you sending (probabely local7.*) syslog output to the console? It seems to me that you just see two messages for one "action".

You can't do ifup eth0 twice without getting an error of some sort. Same goes for portmapper and postfix. You would never see the second green [OK].
0
 

Author Comment

by:SeanD
ID: 2602393
I didn't change anything in the /etc/syslog.conf. I checket the linuxconf network settings and there is only one entry for etho. Everything seems fine, no errors. I'll track it down at some point. Thank you all very much.
Sean
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2602939
Per Reinier's comment... You can get the messages multiple times... For instance, I can  do "/etc/rc.d/init.d/network start" once the system is up and I get:
Bringing up interface lo                                   [  OK  ]
Bringing up interface eth0                                 [  OK  ]

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now