Operating System - HP-UX
1753971 Members
8125 Online
108811 Solutions
New Discussion юеВ

Re: server inaccessible via telnet (((Help plz)))

 
Torsten.
Acclaimed Contributor

Re: server inaccessible via telnet (((Help plz)))

In your situation I would feel better if I can find the source of the problem ... did you check the suggested 4 files?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
meekrob
Super Advisor

Re: server inaccessible via telnet (((Help plz)))

Hello Torsten,

 

i understand what you are saying but going through each file and check each character is really frustrating, that's why i was searchin for a fastest solution especially that this is the only sever i have which is intended for backups.

So, in your opinion (and correct me if im wrong), i need to check the following 4 files:

  • /sbin/init.d/inetd
  • /etc/rc.config.d/SnmpMaster
  • /etc/profile
  • /.profile

Thanks for your help

Torsten.
Acclaimed Contributor

Re: server inaccessible via telnet (((Help plz)))

Only

/etc/rc.config.d/SnmpMaster
/etc/profile
/.profile

and

/etc/PATH



Just look if there is a { instead of /

(on my keyboard both are on the same key)


If you start replacing files from another system, you may produce more problems (if the files are different) without solving the initial problem ...

 

 

 

If you think this too much time consuming, consider to restore your ignite backup have have a consistent status again ...


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
meekrob
Super Advisor

Re: server inaccessible via telnet (((Help plz)))

OK i will do what you already suggested and i will reply back when done.

Many Thanks

meekrob
Super Advisor

Re: server inaccessible via telnet (((Help plz)))

Hello,

 

still have one concern.

Suppose that one of the root's user profile is missing something as you already supposed so, in that case only the root user will be prevented from accessing the server via telnet and not other non superusers or, in this case the whole inetd daemon is not starting. And how can it be that the sever is still accessible via SSH protocol?  isn't the inetd who manages all network services?

 

Thanks in advance

Torsten.
Acclaimed Contributor

Re: server inaccessible via telnet (((Help plz)))

I think sshd is started as a standalone daemon, not via inetd.

 

Why not attach the 4 files in question?


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
meekrob
Super Advisor

Re: server inaccessible via telnet (((Help plz)))

OK i will attach these files asap

Bill Hassell
Honored Contributor

Re: server inaccessible via telnet (((Help plz)))

These errors:

 

     /sbin/rc2.d/K177hpws_apache[46]: Syntax error at line 46 : `{' is not matched.

 

explain the problem fairly well. If you vi the hpws_apache file and look at line 46, you will see:

 

         . /etc/rc.config

So the error is coming from /etc/rc.config. This file does exactly what my small sample script above does. It sources all the files in /etc/rc.config.d. Normally, this script runs without any messages. But in your case, one of the scripts has an error and *every* startup and shutdown step will run rc.config -- thus the large number of error messages. And when the error is detected, the startup script stops, therefore most of your services are not being started. So here is the rc.config script with one modification: it reports the name of each config script. When the bad script is sourced, the error message will appear under the filename.

 

for CFG_FILE in /etc/rc.config.d/* /etc/TIMEZONE
do
echo $CFG_FILE   ## This was added to show the bad filename
        fname=${CFG_FILE##*/}           # get file basename
        if [ -f $CFG_FILE -a "$fname" != "core" -a "${fname##*[.,~\#]}" = "$fname" ]
        then . $CFG_FILE                # source a valid config file
        fi
done

 Just save this text in a file, perhaps /tmp/rctest. Then run it like this:

 

       sh /tmp/rctest

 

It would be a good idea for you to post the results from this script so we can help you.

 

A few posts back, I suggested that you list the files in /etc/rc.config.d in timestamp order. The purpose of this command was to show the most recently edited file at the bottom of the list. My guess is that the failing file in the script above will be one of the mostly recently changed.

 

ls -lrt /etc/rc.config.d


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: server inaccessible via telnet (rc.config.d garbage)

>I tried to check the /etc/rc.config.d directory for garbage files and it seems to be fine as you can see ...

 

No, it still says there is garbage there:

/etc/rc.config.d/SnmpMaster
sh[4]: Syntax error: `{' is not matched.

 

You need to look into SnmpMaster.

You may have to do:

set -x

. /etc/rc.config.d/SnmpMaster

set +x

 

And you may get a better trace of where it goes wrong.

 

Also try to syntax check the file:

sh -n /etc/rc.config.d/SnmpMaster

 

>I compared some of the files and found almost everywhere a line like this
>export PATH=$PATH:/usr/sbin:/usr/bin:/sbin

 

On mine it was nearly always the suspected line: . /etc/rc.config

 

>-r--r--r-- 1 bin bin 4584 Nov 16 12:45 SnmpMaster
>changed, recently, more or less.

 

This file is very suspect.  It is way bigger than mine and /usr/newconfig/etc/rc.config.d/SnmpMaster

 

>I still assume there is something wrong in a "profile" file.

 

I'm not sure why?  These config files are self contained.  If your .profile had a dangling "{", you should see your $PS1 prompt on each line.

 

>The purpose of this command was to show the most recently edited file at the bottom of the list. My guess is that the failing file in the script above will be one of the mostly recently changed.

 

Except that "most recently" is back in Nov.  :-(

meekrob
Super Advisor

Re: server inaccessible via telnet (rc.config.d garbage)

Hi All,

 

kindly find attached the requested output.

@ Torsten, i checked the files you mentioned as you can see in output and tried to output with vi using line numbers to be more clear, however with line numbers and once copied to notepad i got some unreadable text.

It is clear that the /etc/rc.config.d/SnmpMaster file's size is weird, we are investigating if someone brought some modifications to this file without our knowledge.

 

@ Bill, ive tried the script you posted as you can see its output below:

# ./rctest
/etc/rc.config.d/LANG
/etc/rc.config.d/Rpcd
/etc/rc.config.d/SnmpHpunix
/etc/rc.config.d/SnmpMaster
./rctest[6]: Syntax error at line 6 : `{' is not matched.

 

In addition i tried to open the  /etc/rc.config.d/SnmpMaster   file  to see the line 6 as mentionned by the error message above, however, this line in vi is commented by a # mark and it belongs to a comment at the beginning of the  SnmpMaster file.

 

What do you suggest in that case?

 

Thanks in advance for your precious help