Summary: 2 separate instances of ssh under same Sol10 service

From: alex khalil (sunman@khalil.org)
Date: Fri May 19 2006 - 12:41:15 EDT


Thanks to Darren Dunham for his support.

Some confusion in my initial question came from wording used that is
too close to Sun's linguo for a similar but different case.
Instances started through /lib/svc/method/ssh (comparable to
/etc/init.d/ssh) are different than what Sun calls "service instances"

The issue was to have both instances (under any definition) monitored
individually and restarted if either dies.

Using /var/svc/manifest/network/ssh.xml as a base and lifting syntax from
/var/svc/manifest/system/sysidtool.xml for the additional Sun service
instance, with each ssh service instance having its own method and
configuration files yields

--------------
adm00# ls -1 /lib/svc/method/sshd* /etc/ssh/sshd_*
/etc/ssh/sshd_config
/etc/ssh/sshd_alt_config
/lib/svc/method/sshd
/lib/svc/method/sshd_alt

adm00# svcs -a|grep -i ssh
online May_05 svc:/network/ssh:main
online May_05 svc:/network/ssh:alt
--------------

I have not found a way to restart both instances in one command/argument
Wild cards fail: "svcadm restart ssh*" or "svcadm restart ssh:*",
-suggestions welcome- but listing instances explicitly works

-------------
adm00# svcadm -v restart ssh
svcadm: Pattern 'ssh' matches multiple instances:
        svc:/network/ssh:main
        svc:/network/ssh:alt

adm00# svcadm -v restart ssh:main ssh:alt
Action restart set for svc:/network/ssh:main.
Action restart set for svc:/network/ssh:alt.
-------------

----- Forwarded message
Subject: Update: 2 separate instances of ssh under same Solaris 10 service

  The question is how to have both instances of ssh monitored by SMF and
both restarted if either die.

  I was wrong about "only the first instance of ssh is monitored": using
the default configuration, both are monitored. And restart is initiated
(through /lib/svc/method/ssh) if _both_ daemons die.

--------
adm00:# tail -f /var/svc/log/network-ssh:default.log
[ May 2 09:58:40 Stopping because all processes in service exited. ]
[ May 2 09:58:40 Executing stop method (:kill) ]
[ May 2 09:58:40 Executing start method ("/lib/svc/method/sshd start") ]
starting sshd2 on port 22
starting sshd2 on port 55
[ May 2 09:58:40 Method "start" exited with status 0 ]
--------

  How to get a restart initiated if _either_ daemon dies?

On Tue, May 02, 2006 at 02:35:49AM +0000, alex khalil wrote:
> I'm trying to have two separate instances of ssh controlled under the
>same service.
>
> The instances are on different ports and with different authorization
>settings, however I would like to control and monitor them under the
>same service.
>
> Modifying the file /lib/svc/method/ssh is simple but how to convince
>/var/svc/manifest/network/ssh.xml to monitor both instances and restart
>them if either fails.
>
> Currently, after modifying only /lib/svc/method/ssh, only the first
>instance of ssh is monitored and if the other one dies, no restart occurs.
>
> If nothing else works, I'll put each instance under a separate service.
>
> Thanks
>
>alex
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:39:55 EDT