Chkconfig & SMF


 
Thread Tools Search this Thread
Operating Systems Solaris Chkconfig & SMF
# 1  
Old 01-04-2010
Chkconfig & SMF

Hi

I have been told to migrate linux init scripts to solaris 10. i am reading about the chkconfig & SMF ( I came to know that SMF is used in Sol 10 for service management ). The only thing i could not find out ( Because i dont have root access ) is how the links are created in rcX.d directory?

I will try to explain what i understood from different article i found on net

1) there are different run levels generally 0-6 & S/s
2) Default is run level 3
3) with chkconfig user can create links in /etc/rcX.d
4) these links are hard links to files in init.d
5) when server boots up ( assume in run level 3 ) it executes all the scripts whose name starts with "S" under /etc/rc3.d
6) changing that initial letter to something else will skip that test being executed at start

please correct me if what i understood is wrong.

so my question was just by specifying something like in script will create a link under rc3.d dir ?

Code:
#!/bin/sh
# chkconfig: 3 20 20 
# description: blah blah

or do i have to write a script which will create a link in rcX.d folder to this files ?
# 2  
Old 01-04-2010
Debian

SMF does not used the /etc/rc?.d/ directories we know and love, it has a set of mlestones, e.g. single-user and multi-user that replicate the run levels. To dictate the order that the services are started in (some may start in parallel) each service has dependencies, e.g. the DNS client will only start once networking has been established and local mounts have been made, a service can also have dependents, e.g. don't allow dtlogin to start until I (e.g. LDAP) am running, these can be listed by running:
Code:
# svcs -d  <servicename>

and
Code:
# svcs -D <servicename>

To see the state of all the services you may run:
Code:
# svcs -a

and to see what have failed you may run:
Code:
# svcs -xv

To start a service you can run:
Code:
# svcadm enable <servicename>

and to stop it you can run:
Code:
# svcadm disable <servicename>

A "-t" parameter makes the change of state temporary (the service will restart on the next reboot rather than staying enabled/disabled) and the "-r" parameter ensures that when starting a service that requires dependencies that they are all started also.

The services are defined using xml files and call scripts very like those that used to appear in /etc/init.d but can also ensure that if a daemon stops running that it gets restarted.

See:
BigAdmin Topic: Solaris Service Management Facility - Quickstart Guide
and:
http://docs.sun.com/app/docs/doc/819...%29#See%20Also


Concerning what you have said:

1. The default run level on a machine that uses the rc scripts is changeable and for a Linux type machine it is 3 for a machine that does not require a GUI (e.g. a web or database server) and is 5 for machine that does (usually desktop machines). The default run level is defined in the /etc/inittab file.

2. Solaris machines (pre SMF) run through all the scripts from rcS.d to rc3.d (or higher), Linux machines (well RedHat anyway) run only those scripts in the default run level's directory which is why you will see links for some services in rc1.d, rc2.d and rc3.d. The S* scripts are run on boot up and the K* scripts on shutdown, changing the S or K to s or k will cause those scripts to be not run.

3. The rc?.d links are usually created by the package or manually on a Solaris system, unlike Linux where chkconfig looks for the chkconfig line in the /etc/init.d script to tell it what links to create for you.

4. The script header you show will cause chkconfig to create S20* and K20* links in the /etc/rc3.d directory only for the service you have installed into /etc/init.d when you run:
Code:
# chkconfig --add <servicename>

Where <servicename> is the name of the script you have installed into /etc/init.d on a Lnux machine but not on a Solaris machine.

HTH

Last edited by TonyFullerMalv; 05-16-2010 at 07:19 PM.. Reason: Corrected book up to boot up!
# 3  
Old 01-05-2010
Just a couple of comments/clarifications:
Quote:
Originally Posted by TonyFullerMalv
1. The default run level on a machine that uses the rc scripts is changeable and for a Linux type machine it is 3 for a machine that does not require a GUI (e.g. a web or database server) and is 5 for machine that does (usually desktop machines).
This is however distribution dependent. i.e. slackware uses run level 4 instead of 5 for GUI. Gentoo, Debian, Ubuntu make no distinction between run levels 2,3,4 and 5.
Quote:
2. Solaris machines (pre SMF) run through all the scripts from rcS.d to rc3.d (or higher)
Post SMF Solaris machines also run the rcS.d, rc2.d and rc3.d scripts, a.k.a. legacy startup scripts. Converting startup scripts to smf, while recommended for obvious reasons isn't mandatory.
# 4  
Old 01-05-2010
MySQL

jlliagre,

1. Thanks for the clarification on other flavors of Linux.

2. Yes, I neglected to mention that rc scripts still work under Solaris 10 and that "svcs -a" lists them as legacy objects, this enables software intended for earlier versions of Solaris that install rc scripts to still work under Solaris 10.

Smilie
# 5  
Old 01-06-2010
@TonyFullerMalv

thanks for your reply. i am now thinking of using rcX.d scripts ( because in our org other scripts are implemented that way !! )

i thought of creating new thread for some of my questions then i thought why not put it here only

1 ) i have started migrating scripts from linux to solaris i am going through scripts and i found that all init script uses
Code:
. /etc/init.d/functions

which is not there in Solaris!! so what is the solution ? write my own script which with required functions ?

2) In init scripts empty file is created under /var/lock/subsys to avoid duplicate start. how this is implemented in solaris ? i tried searching but couldnt find any useful information.

you can redirect me to some relevant website i will do the rest Smilie
# 6  
Old 01-06-2010
Dare I suggest you simply take a copy of the /etc/init.d/functions script and translate any minor changes required to make it Solaris compatible?
Do your scripts actually use any of the functions?
# 7  
Old 01-06-2010
so are you only planning to run legacy scripts or are you going to let SMF manage it? I couldn't find it anywhere in the thread.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do i disable kudzu without using chkconfig

How do i disable kudzu without using chkconfig? /sbin/chkconfig --level 3 kudzu off Is there any other way of doing it . for example by modifying parameter of any file. Basically i want kudzu to be disabled during the first run of the machine after installation. I have full access to the... (2 Replies)
Discussion started by: pinga123
2 Replies

2. Infrastructure Monitoring

Using SMF to register & start a (Nagios) service

I'm trying to register & start a service using SMF on Solaris 10. It's nsca, part of the Nagios monitoring system. I've got nsca running fine as a detached process, and can manually create passive checks via send_nsca. But when I try to run nsca as a daemon, I need some advice. The nsca... (0 Replies)
Discussion started by: lyle
0 Replies

3. Solaris

SMF in Solaris 10

In SOlaris 9 for eg, inside the /etc/init.d/inetsvc file, you can set the tcp tracing by going to the last line and adding the following as :- inetd -s -t & In Solaris 10, I know we can use the svccfg to do it or with the inetadm command. When I use inetadm -m command to set the tcp tracing... (3 Replies)
Discussion started by: incredible
3 Replies

4. Red Hat

chkconfig error

I'm just trying to disable some of un used services. when i try that I'm getting following error. This is just for one "gpm" service failed to make symlink /etc/rc3.d/K15gpm: Read-only file system failed to make symlink /etc/rc4.d/K15gpm: Read-only file system failed to make symlink... (1 Reply)
Discussion started by: s_linux
1 Replies

5. Solaris

Solaris 8 how do I enable and disable services? (equivalent of chkconfig on Linux)

I've successfully installed syslog-ng and chkconfig using the packages from the OpenCSW project, these packages install under /opt/csw. I now need to disable the default syslog daemon and enable the new service created by the OpenCSW package (/etc/init.d/cswsyslog_ng). Is there any good way to... (3 Replies)
Discussion started by: aussieos
3 Replies

6. Solaris

SMF service HELP

I would like to run command whenever system boot up, i.e "/opt/admin/script/closegen -c /opt/share/script/colsehg" How do I integrate above command in to SMF services. -sam (1 Reply)
Discussion started by: sam786
1 Replies

7. Solaris

smf repository not running

Hi All, I have a Solaris server which runs version 10 After installing the patch , i thought of doing a recongiuration reboot But it failed saying "smf repository not running" what could be the issue. Thanks J (4 Replies)
Discussion started by: jegaraman
4 Replies

8. UNIX for Advanced & Expert Users

chkconfig utility in solaris 10

I want to use chkconfig utility to simplify service management on Solaris 10. However, I couldn't find this utility. I tried " man chkconfig", the system return as " No manual entry for chkconfig". So what does this mean and how to find this utility on solaris 10? Thanks for your help. Happy New... (8 Replies)
Discussion started by: duke0001
8 Replies

9. Red Hat

attempting to install chkconfig 1.3.5

Hi there everyone, I'm using redhat 7.3 at the moment and am currently trying to install chkconfig-1.3.5-3.i386.rpm , but when I type this command: rpm -Uvh chkconfig-1.3.5-3.i386.rpm I get the following error: error: failed dependencies: chkconfig = 1.2.24 is needed by... (3 Replies)
Discussion started by: redhat_newb101
3 Replies

10. UNIX for Dummies Questions & Answers

Standalone FTPD within SMF

Hello We are trying to run the WU_FTPD demon in standalone mode (-S argument) via an SMF service. Prior to SMF, this was achieved by simply commenting out the FTP line within the inetd.conf file. However, within SMF, I believe we need to carry out the following activities: i) Remove the FTP... (0 Replies)
Discussion started by: CowsUdders
0 Replies
Login or Register to Ask a Question