Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

start and stop syntax for ssh service OR Sendmail

Created: 10 Oct 2012 • Updated: 10 Oct 2012 | 15 comments
Zahid.Haseeb's picture
This issue has been solved. See solution.

Environment

Solaris = 10

HA = 6.0

Query

What would be the start and stop syntax to cluster ssh on solaris 10. I used the below configuration but still there is a question mark on my resource and I am not able to UP this ssh resource in my service group.

My configuration

start program = svcadm enable ssh

stop program = svcadm disable ssh

PIDfiles = /var/run/sshd.pid

Discussion Filed Under:

Comments 15 CommentsJump to latest comment

mikebounds's picture

I think you may have to put in the full path for svcadm as I think the Application agent may check this exists - if this is issue, there should be errors in the engine or Application log saying something like "program svcadm does not exist".

Why do you want to put ssh under VCS control as ssh does not normally need to be failed over - i.e it runs on all servers, not just one and in particular you don't normally want to stop ssh as then you can't get to node via ssh, only leaving unsecure connection of telnet or logging on to console.  If you just want VCS  to monitor ssh you could put resource in a parallel service group, but ssh will still be shutdown if you stop VCS, so it is better to create as an ONONLY resource which you can then put in a failover or parallel service group without ssh ever being shutdown - if you want to know how to do this, let me know.

Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

Thanks Mike for your reply. It was an example.Let you take a sendmail service instead of ssh

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

Most sevices are not created as OnOff resources, but as OnOnly like NFS resource type, so you may want to consider using ProcessOnOnly agent for services.

Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

mikebounds's picture

I looked at Application agent in Bundled agents guide and you do have to specify ful path, so this is probably your issue:

 

StartProgram
The executable, which starts the application. Specify the complete
path of the executable. Applicable command line arguments follow
the name of the executable and have spaces separating them
 

Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

emmmmhhh ...its too easy in redhat :(

 

#svcadm enable svc:/network/smtp:sendmail     (am I right)

#svcadm disable svc:/network/smtp:sendmail    (am I right)

#what could be monitor program ?

 

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

Zahid.Haseeb's picture

Done

Found monitor process. See the below bold line for monitoring the monitor process.

ps -ef |grep sendmail
   smmsp  4943     1   0 18:29:49 ?           0:00 /usr/lib/sendmail -Ac -q15m
    root  4941     1   0 18:29:49 ?           0:00 /usr/lib/sendmail -bd -q15m
    root  5162  5156   0 19:01:00 pts/1       0:00 grep sendmail

 

Did I select the right monitor process to monitor ?
 

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

You need to use full path for start/stop executable and you can select any process or list of processes you want, but you must specify the complete string as you see it in ps and it must be owned by the user specified by "User" attribute or root if this is blank.  So if you are using system scripts to start and stop processes, then these will need to be run by root so your monitor porocess in your example is "/usr/lib/sendmail -bd -q15m" and "/usr/lib/sendmail -Ac -q15m" would not work at this is owned by smmsp.

Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

Ahh thanks. Now final problem

start program                      svcadm enable svc:/network/smtp:sendmail

stop program                      svcadm disable svc:/network/smtp:sendmail

monitor program                 /usr/lib/sendmail -bd -q15m

I mentioned thet above attributes. I am able to offline the sendmail. I can kill the process ID and monitor process declare the resource as crashed. Now I am only not able to online the resource. Its going going going to be online but cant.

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

As said earlier I think you need to use full path so start program should be something like:

/sbin/svcadm enable svc:/network/smtp:sendmail or where ever svcadm is on RHEL.

If this does not work - what do the logs say?

Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

usr/sbin/svcadm enable svc:/network/smtp:sendmail    still not able to UP the resource

But now the fun part. I used the below command and it worked for start/online

usr/sbin/svcadm restart svc:/network/smtp:sendmail

.......

Result when offline the resource

bash-3.00# ps -ef |grep sendmail
    root  6048  5700   0 19:53:41 pts/1       0:00 grep sendmail
   smmsp  6034     1   0 19:52:18 ?           0:00 /usr/lib/sendmail -Ac -q15m

 

Result when online the resource

bash-3.00# ps -ef |grep sendmail
   smmsp  6090     1   0 19:55:18 ?           0:00 /usr/lib/sendmail -Ac -q15m
    root  6088     1   0 19:55:18 ?           0:00 /usr/lib/sendmail -bd -q15m
    root  6101  6097   0 19:55:49 pts/1       0:00 grep sendmail

 

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

Zahid.Haseeb's picture

Thanks Mike for such a great help... Marking the helpful post with +thumb

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

I don't know much about RHEL service commands, but enable/disable sound bad keyword if these are right - normally keywords are start/stop as disable/enable mean something different to me.

If stop script is not working - then you should get message in log something like "resource up after offline completed" - then it will the clean which will kill processes specified by MonitorProcesses, so it looks like this is happening and hence "root" process is killed, but "smmsp" process remains.

You can test commands using something like:

su - root -c "/usr/bin/svcadm enable svc:/network/smtp:sendmail"

which is what VCS is doing

Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

a little snap of logs for reference :

 

Oct 10 19:53:37 Solaris2 AgentFramework[4836]: [ID 702911 daemon.notice] VCS ERROR V-16-2-13068 Thread(4) Resource(Application) - clean completed successfully.
Oct 10 19:54:18 Solaris2 sendmail[6071]: [ID 702911 mail.crit] My unqualified host name (localhost) unknown; sleeping for retry
Oct 10 19:54:18 Solaris2 sendmail[6072]: [ID 702911 mail.crit] My unqualified host name (localhost) unknown; sleeping for retry
Oct 10 19:55:18 Solaris2 sendmail[6071]: [ID 702911 mail.alert] unable to qualify my own domain name (localhost) -- using short name
Oct 10 19:55:18 Solaris2 sendmail[6072]: [ID 702911 mail.alert] unable to qualify my own domain name (localhost) -- using short name
Oct 10 20:03:14 Solaris2 in.routed[537]: [ID 464608 daemon.error] route 10.0.0.0 --> 10.0.0.2 nexthop is not directly connected
Oct 10 20:13:14 Solaris2 in.routed[537]: [ID 464608 daemon.error] route 172.16.0.0 --> 172.16.0.2 nexthop is not directly connected
Oct 10 20:23:14 Solaris2 in.routed[537]: [ID 464608 daemon.error] route 10.0.0.0 --> 10.0.0.2 nexthop is not directly connected
Oct 10 20:23:22 Solaris2 Had[766]: [ID 702911 daemon.notice] VCS ERROR V-16-10001-2 (Solaris2) Application:Application:offline:Program (svcadm) does not exist or is not executable
Oct 10 20:23:23 Solaris2 AgentFramework[4836]: [ID 702911 daemon.notice] VCS ERROR V-16-2-13064 Thread(4) Agent is calling clean for resource(Application) because the resource is up even after offline completed.
Oct 10 20:23:23 Solaris2 Had[766]: [ID 702911 daemon.notice] VCS ERROR V-16-2-13064 (Solaris2) Agent is calling clean for resource(Application) because the resource is up even after offline completed.
Oct 10 20:23:23 Solaris2 AgentFramework[4836]: [ID 702911 daemon.notice] VCS ERROR V-16-2-13068 Thread(4) Resource(Application) - clean completed successfully.
Oct 10 20:23:28 Solaris2 Had[766]: [ID 702911 daemon.notice] VCS ERROR V-16-10001-2 (Solaris2) Application:Application:online:Program (su) does not exist or is not executable
Oct 10 20:24:49 Solaris2 last message repeated 1 time
Oct 10 20:27:03 Solaris2 sendmail[6409]: [ID 702911 mail.crit] My unqualified host name (localhost) unknown; sleeping for retry
Oct 10 20:27:03 Solaris2 sendmail[6410]: [ID 702911 mail.crit] My unqualified host name (localhost) unknown; sleeping for retry
Oct 10 20:28:03 Solaris2 sendmail[6409]: [ID 702911 mail.alert] unable to qualify my own domain name (localhost) -- using short name
Oct 10 20:28:03 Solaris2 sendmail[6410]: [ID 702911 mail.alert] unable to qualify my own domain name (localhost) -- using short name
Oct 10 20:28:04 Solaris2 AgentFramework[4836]: [ID 702911 daemon.notice] VCS ERROR V-16-2-13067 Thread(4) Agent is calling clean for resource(Application) because the resource became OFFLINE unexpectedly, on its own.
Oct 10 20:28:04 Solaris2 Had[766]: [ID 702911 daemon.notice] VCS ERROR V-16-2-13067 (Solaris2) Agent is calling clean for resource(Application) because the resource became OFFLINE unexpectedly, on its own.
Oct 10 20:28:04 Solaris2 AgentFramework[4836]: [ID 702911 daemon.notice] VCS ERROR V-16-2-13068 Thread(4) Resource(Application) - clean completed successfully.
bash-3.00#
 

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

This is saying what I said it would:

Oct 10 20:23:22 Solaris2 Had[766]: [ID 702911 daemon.notice] VCS ERROR V-16-10001-2 (Solaris2) Application:Application:offline:Program (svcadm) does not exist or is not executable

 

because you have not used full path forr svcadm in StopProgram

and

Oct 10 20:23:23 Solaris2 AgentFramework[4836]: [ID 702911 daemon.notice] VCS ERROR V-16-2-13064 Thread(4) Agent is calling clean for resource(Application) because the resource is up even after offline completed

 

so clean is called and smmsp process is left behind.

Mike

 

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

SOLUTION
Zahid.Haseeb's picture

Appoligize: I only did full path with stop program :(

Marking your post as solution and +thumb too ;)

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com