Operating System - HP-UX
1833838 Members
2569 Online
110063 Solutions
New Discussion

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

 
SOLVED
Go to solution

"Syntax error at line 162 ..." appearing in /etc/rc.log

Recently we relocated an rp5430 running 11.11 to a new rack. We didn't change any hardware or software configurations but when we powered up the server, hostname and lan0 were not set. In the /etc/rc.log file I noticed a number of run scripts generated the identical error message:

Syntax error at line 162 : '"' is not matched.

As a result, hostname, net and a number of other run scripts were skipped. The common thing about all of the "Syntax error ..." was that each occurred at basically the identical run script line:

. /etc/rc.config
OR
. /etc/rc.config/netconf -- for net

Does anybody know what happened and how to correct this?
18 REPLIES 18
Mel Burslan
Honored Contributor
Solution

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Steve,

Looks like in the /etc/rc.config.d/netconf file, you are missing a quotaion mark, which is throwing the /sbin/init.d/net script off.

Check the netconf file and find an unclosed quotation mark would be my first suggestion.

Mel.
________________________________
UNIX because I majored in cryptology...

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Mel,

As I stated above, no configuration files were changed in the move (and the system worked fine before the move) and the syntax error appears at least 20 times for various run scripts in rc.log. I know that I've seen this error before I can't remember what the fix was. Sorry Mel and it is me.
Peter Nikitka
Honored Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Hi,

first really look into /etc/rc.config/netconf .

Then look for 'backup files' in /etc/rc.config.d - these have to be moved to another place. Some get sorted out automatically, but ...

This way you can get all line numbers 162 of these files:
cd /etc/rc.config.d
for f in *
do
print -n "$f: "
sed 162!d $f
print
done

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
George Liu_4
Trusted Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

I guess it helps if you post the rc.log and the file where syntax error occurred.

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

You read my mind since things seem to be going off on a tangent. Everybody just remember this, no file changes were made. We merely moved the server.
spex
Honored Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Hi Steven,

Not to beat a dead horse, but 'netconf' could have been changed a long time ago. However, the changes wouldn't have taken effect until reboot.

# ls -l /etc/rc.config.d/netconf

to see last modification of the inode.

Whatever the cause, the solution is just a matter of finding the mismatched quote. It would be more useful to post your netconf.

PCS
Doug O'Leary
Honored Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Hey;

Also, ensure *only* valid configuration files are in there - no core files, no backup config files, etc.

Reason is several of the /sbin/init.d scripts will source the entire /etc/rc.config.d directory. When that happens and you have a core file or something else that should be in there, bad things result.

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
James R. Ferguson
Acclaimed Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Hi:

As Mel and Peter have suggested, '/etc/rc.config.d/netconf' may be the culprit.

One approach to finding problems like this is to do:

# sh -vx /etc/rc.config 2>&1|more

For example, by making a deliberate configuration error in 'netconf' by dropping a paired double quote, the above ran and stopped with:

+ [ -f /etc/rc.config.d/netconf -a netconf != core -a netconf = netconf ]
+ . /etc/rc.config.d/netconf
/etc/rc.config[11]: Syntax error at line 98 : `"' is not matched.

The line numbers are *misleading* since I made the error at line-50, but lines 51-85 are comments and the shell didn't "decide" it had a synatx error until near line-98.

However, the sourcing of the '/etc/rc.config.d' directory's files stopped at the first culprit, enabling one to begin to isolate the problem more easily.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Hi (again):

With regard to how the '/etc/rc.config.d' directory is processed, it is true that any file therein is a candidate for processing with the *exception* that you *can* have backup copies of files that are *not* processed.

When '/sbin/rc' runs, the '/etc/rc.config.d' directory is examined by the script '/etc/rc.config'. This script skips any file whose basename contains an "extension" that begins with the characters [.,~#].

Thus, it is permissible to have 'netconf' and 'netconf.old'. The '.old' backup will *not* be processed.

If, however, you had kept an old version of your 'netconf' file named as, 'oldnetconf', then *both* 'netconf' and 'oldnetconf' would be sourced. Since the letter "o" follows "n", the result would be undesirable insofar as the last variable declarations seen would be from the wrong file.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

I would bet that there is a spurious file in /etc/rc.config.d but you violated one of the fundamental rules I learned decades ago. Before moving, re-racking, re-cabling, ... any box always make sure that the box will boot as is. Yes, it takes a little while to go through the extra boot cycle and shutdown BUT you know that you started with a known working box. This is especially true of boxes which have not been booted in months because some of the rc stuff might have changed and was never tested.

If it ain't broke, I can fix that.

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Actually one week prior to its move, I did indeed power down the box (to install a 4 port NIC) and it came up fine afterwards. I'll post the netconf shortly (need to go to the console to push the file to another box, etc).
A. Clay Stephenson
Acclaimed Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

One week earlier doesn't count. A week is an eternity for someone to "improve" your box.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

One thing that does occur to me is that you may be running a different UPS and the monitor daemon may have changed. Are you using rack-mounted UPS's and if so, is anything different there?
If it ain't broke, I can fix that.

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

I've attached the netconf file (sanitized for your protection).

The previous racks used a Pulizzi to provide failover between power A and power B. The new racks have APC power strips that are supposed to automatically fail over between power A and B as necessary.
James R. Ferguson
Acclaimed Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Hi (again):

Well, look at this:

BROADCAST_ADDRESS[1]="11.11.11.255

...there is indeed a missing (closing) double quote!

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Just to reiterate Clay and James -- nothing was changed but there really was something changed. The fastest way to discover garbage in /etc/rc.config.d is this command:

ll -t /etc/rc.config.d

This sorts the directory so that the most recently changed file(s) jump top the top. NOTE: NEVER, EVER leave junk files or old copies of config files in /etc/rc.config.d. Unlike other directories, this one is 100% executed for *EVERY* startup script and those junk files will cause almost start script to abort. The culprits will be at the top of the list.


Bill Hassell, sysadmin

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

It was an ID10T error (and time for new glasses) 8-}

The thing that threw me off was all of the syntax errors in rc.log, including one that occurred before it referenced netconf.

Re: "Syntax error at line 162 ..." appearing in /etc/rc.log

Thanks for all the help everyone.