How to auto start a service on rebooting a Solaris 5.10 x86 machine? | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

How to auto start a service on rebooting a Solaris 5.10 x86 machine?

Solaris


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-31-2013
ziosnim ziosnim is offline
Users Awaiting Email Confirmation
 
Join Date: May 2011
Last Activity: 7 February 2013, 9:31 PM EST
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
How to auto start a service on rebooting a Solaris 5.10 x86 machine?

Hi all,

How to auto start a snmpd deamon on rebooting a Solaris 5.10 x86 machine.

snmpd's path: /opt/download/net-snmp/sbin

Thank you in advance.
Sponsored Links
    #2  
Old 01-31-2013
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
 
Join Date: Dec 2003
Last Activity: 13 May 2013, 9:02 AM EDT
Location: Melbourne, Australia
Posts: 2,185
Thanks: 3
Thanked 24 Times in 23 Posts
With Solaris 10, you'll need to create an SMF manifest, import it via svccfg import , and administer the service via svcadm . Whilst legacy "init" scripts are still supported, you should definitely be using SMF where possible.

Understanding SMF is beyond the scope of a forum post, so I'd suggest reading the appropriate documentation on the Oracle site for further information.
Sponsored Links
    #3  
Old 01-31-2013
ziosnim ziosnim is offline
Users Awaiting Email Confirmation
 
Join Date: May 2011
Last Activity: 7 February 2013, 9:31 PM EST
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
Hi zazzybob,


Thank you for your reply.

Please let me know how to add to "init" script.

Thank you in advance.
    #4  
Old 01-31-2013
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
 
Join Date: Dec 2003
Last Activity: 13 May 2013, 9:02 AM EDT
Location: Melbourne, Australia
Posts: 2,185
Thanks: 3
Thanked 24 Times in 23 Posts
Hi,

Create an appropriate script under /etc/init.d (accepting at minimum start and stop arguments) and then create the appropriate S* and K* links under the runlevel directories you wish the service to start (and stop) in. Most default Solaris 10 services that still use init scripts use hard links, e.g.


Code:
# ls -li /etc/rc2.d/S98deallocate /etc/init.d/deallocate
      1852 -rwxr--r--   2 root     sys          733 Jun 29  2011 /etc/init.d/deallocate
      1852 -rwxr--r--   2 root     sys          733 Jun 29  2011 /etc/rc2.d/S98deallocate

Have a look at some of the existing scripts under /etc/init.d to understand how they need to be written.

This may seem like the easy option - but I strongly recommend getting to grips with SMF.

Cheers,
ZB
Sponsored Links
    #5  
Old 01-31-2013
ziosnim ziosnim is offline
Users Awaiting Email Confirmation
 
Join Date: May 2011
Last Activity: 7 February 2013, 9:31 PM EST
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
Hi,

Thank you for your quick reply.

I did it comply with your request. I will study SMF function.

Thank you in advance.
Sponsored Links
    #6  
Old 01-31-2013
achenle achenle is offline
Registered User
 
Join Date: Jun 2009
Last Activity: 22 October 2014, 10:50 PM EDT
Posts: 718
Thanks: 1
Thanked 102 Times in 98 Posts
Just write an init script. It's simple, understandable, and even more important easily maintainable for someone in the future.

SMF services are none of that.

SMF services are great when you have complex dependencies between various services and events. But just because you have a hammer doesn't make every problem a nail.
The Following User Says Thank You to achenle For This Useful Post:
elixir_sinari (01-31-2013)
Sponsored Links
    #7  
Old 01-31-2013
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
 
Join Date: Dec 2003
Last Activity: 13 May 2013, 9:02 AM EDT
Location: Melbourne, Australia
Posts: 2,185
Thanks: 3
Thanked 24 Times in 23 Posts
Quote:
Originally Posted by achenle View Post
Just write an init script. It's simple, understandable, and even more important easily maintainable for someone in the future.

SMF services are none of that.

SMF services are great when you have complex dependencies between various services and events. But just because you have a hammer doesn't make every problem a nail.
Sun and now Oracle have insisted that init scripts are "legacy" and will be removed in a later Solaris release. Also, they no longer guarantee the order in which they'll be started or stopped, as the init scripts are themselves executed by an SMF service.

So - you should be using SMF, even for simple things. It's the way Solaris has evolved and is evolving. It's not hard to write an SMF manifest for a simple service once you've read the documentation.
The Following User Says Thank You to zazzybob For This Useful Post:
ziosnim (01-31-2013)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
is there an veritas volume manager version compatible with solaris x86 machine? chidori Solaris 2 06-12-2011 09:02 PM
How to auto start MySQL server on Opensolaris after rebooting the machine? AlexCheung Solaris 4 04-23-2011 01:11 AM
x86 Sun Machine and Solaris Soft Mirror tien86 Solaris 5 05-24-2009 04:33 AM
How can I install Solaris 10 x86 on a machine without a DVD drive? Bradj47 UNIX for Dummies Questions & Answers 1 12-20-2008 11:38 AM
Auto Start/Stop Didnt Work in Solaris 10 adzuanamir Solaris 0 04-22-2008 11:25 PM



All times are GMT -4. The time now is 12:31 AM.