Page 1 of 1

A simple beginners guide to trouble shooting services in Solaris 10 Rate Topic: -----

#1 Gorian   User is offline

  • ninja DIC
  • member icon

Reputation: 153
  • View blog
  • Posts: 1,853
  • Joined: 28-June 08

Posted 31 December 2012 - 03:38 PM

when working with files, it is inevitable that you will encounter a service that is not working, for one reason or another. Usually because you fat fingered a config file. The important thing is knowing how troubleshoot it.

you have two important commands in Solaris

svcadm, and svcs. An easy Mnemonic is service admin, and service status, respectively.

svcadm is the solaris equivalent of the linux service while the svcs command can be said to be the equivalent of the service status command.

So, for the sake of demonstration, so we accidentally threw the following line into our SSH config file (/etc/ssh/sshd_config):

Hello Dreamincode!

so now we have the following in our config file:
# Banner to be printed before authentication starts.
#Banner /etc/issue

Hello Dreamincode!

# Should sshd print the /etc/motd file and check for mail.
# On Solaris it is assumed that the login shell will do these (eg /etc/profile).
PrintMotd no

then, we restart our service:
svcadm restart ssh

it will then spit out the following error:
bash-3.00# Dec 31 14:15:06 HOSTNAME svc.startd[7]: net
work/ssh:default failed: transitioned to maintenance (see 'svcs -xv' for details)

Now isn't that nice? It gave us the next step to troubleshoot the issue.

so, instead of svcs -xv (which will give us the status of ALL failed services) we only care about ssh, so will do the following:
svcs -xv ssh

which replies:
bash-3.00# svcs -xv ssh
svc:/network/ssh:default (SSH server)
 State: maintenance since Mon Dec 31 14:15:06 2012
Reason: Start method failed repeatedly, last exited with status 255.
   See: man -M /usr/share/man -s 1M sshd
   See: /var/svc/log/network-ssh:default.log
Impact: This service is not running.

man svcs gives us the following explanation:
     -v                  Without -x,  displays  verbose  columns:
                         STATE, NSTATE, STIME, CTID, and FMRI.

                         With -x, displays extra information  for
                         each explanation.

     -x                  Displays   explanations   for    service

                         Without   arguments,   the   -x   option
                         explains the states of services which:

                             o    are enabled, but are  not  run-

                             o    are preventing another  enabled
                                  service from running.

so, that is informative. It is set to maintenance. To find out why, we'll check the log it gave us:
cat /var/svc/log/network-ssh:default.log

to cut out all the other stuff and get to the relevant:
[ Dec 31 14:15:06 Executing start method ("/lib/svc/method/sshd start") ]
/etc/ssh/sshd_config: line 65: Bad configuration option: Hello
/etc/ssh/sshd_config: terminating, 1 bad configuration options
[ Dec 31 14:15:06 Method "start" exited with status 255 ]

so, we now know that we have an error in our config on line 65.

since I am using vi, I will enter the following: :set nu to display line number, and scroll down to line 65 in our sshd_config.

After I delete the line in the config, and save the file, I'll clear the maintenance status of the service:

svcadm clear ssh

then restart it for good measure:

svcadm restart ssh

now, if we look at the status of our service:
svcs ssh

bash-3.00# svcs ssh
STATE          STIME    FMRI
online         14:29:45 svc:/network/ssh:default

All fixed.

Is This A Good Question/Topic? 1
  • +

Replies To: A simple beginners guide to trouble shooting services in Solaris 10

#2 KYA   User is offline

  • Wubba lubba dub dub!
  • member icon

Reputation: 3202
  • View blog
  • Posts: 19,233
  • Joined: 14-September 07

Posted 13 January 2013 - 12:09 PM

Good to know, I hate Solaris with a purple passion.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1