Technical article 109531

I see the error "/etc/tcp: syntax error at line 257: `;;' unexpected" during bootup.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4

Written · Last revised

Problem

During bootup, or when I manually try to stop and start TCP services, I see an error:

/etc/tcp: syntax error at line 257: `;;' unexpected
          The exact line number in the error may vary slightly.
Also, the                 characters being complained about may vary as well.

Cause

There is a missing "fi" in one of the script's if-then statements. This is often caused by an administrator having commented out one or more non-essential services (so they don't automatically start during bootup), then only partially uncommenting the lines when they change their mind and allow the service to start normally.

This causes the subsequent if statements to appear nested, and the
/etc/tcp script then expects a final "fi" to close out the buried
"if"'s.

For example, if /etc/tcp originally contained the passage:

if [ -x /etc/gated -a -f /etc/gated.conf ]; then
        /etc/gated &
        echo "gated \c"
fi

The administrator commented it out in order to prevent gated from running:

#      if [ -x /etc/gated -a -f /etc/gated.conf ]; then
#              /etc/gated &
#              echo "gated \c"
#      fi

He later decided to re-enable gated, but made an editing mistake:

if [ -x /etc/gated -a -f /etc/gated.conf ]; then
        /etc/gated &
        echo "gated \c"
#      fi

To correct the problem, all of the commented-out lines must be uncommented:

if [ -x /etc/gated -a -f /etc/gated.conf ]; then
        /etc/gated &
        echo "gated \c"
fi

Solution

Either restore the file /etc/tcp from a known working copy on your backups, or manually trace through the file to make sure all "if"'s have corresponding "fi"'s to them.

From the Xinuos technical article database, record 109531. Reproduced with permission. The original is at www.sco.com/ta/109531, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.