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"
fiThe 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"
# fiHe 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"
# fiTo 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.