LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-28-2006, 11:36 AM   #1
linuxtesting2
Member
 
Registered: Mar 2004
Location: Norway
Distribution: Freebsd, Fedora, Redhat, Solaris 10
Posts: 169

Rep: Reputation: 30
svc / smf questions


Hi...


Im having "fun" with SMF commands and i have some questions to clear my mind

Im reading that the svcadm is where i can ex. change runlevel, that i can do with the command

$svcadm milestone mileston/single-user
$ who -r
. run-level S Mar 28 19:20 S 0 3
$

Still my ssh connection works, so i try to change back to runlevel 3 with the command

$ svcadmin milestone milestone/multi-user-server

but i still have the singel modus, then i try the

$ init 3

But still singel modus, then i try "init 6" no change


Dont know why that happend

Some other questions is how do i list the default runlevel, guess there is some options for the svcadm command.


Another thing is the processes that is running in the current level, if i change to singel modus and i check "ps -ef" i can still se that the sshd / httpd process is running. I know i cant connect to the processes but why show that they are running ?
If i use the "svcs" i can see that the process is offline, and how can i just start 1 process with the svcadm command.


Thanks for shareing your expertise


Ole
 
Old 03-28-2006, 09:51 PM   #2
apt-get-dude
Member
 
Registered: Mar 2006
Posts: 98

Rep: Reputation: 15
There are several bugs in sunsolve.sun.com regarding this.

Check out bug id 4206017, 6175398 and 1164931
 
Old 03-29-2006, 06:07 AM   #3
linuxtesting2
Member
 
Registered: Mar 2004
Location: Norway
Distribution: Freebsd, Fedora, Redhat, Solaris 10
Posts: 169

Original Poster
Rep: Reputation: 30
Ok thats clearing my brain

Still need some info about the following:

1. How do i list the default runlevel, guess there is some options for the svcadm command ?
2. How can i just start 1 process with the svcadm command ?
3. What are the advantage of using svc instead of init ?


Regards
Ole
 
Old 03-29-2006, 11:52 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by linuxtesting2
Ok thats clearing my brain

Still need some info about the following:

1. How do i list the default runlevel, guess there is some options for the svcadm command ?
Quoting the manual page:

The default milestone is defined by the options/milestone property on the master restarter, svc:/system/svc/restarter:default. If this property is absent, "all" is the default.
Quote:
2. How can i just start 1 process with the svcadm command ?
You start a service with the enable [-t] or restart command.
Quote:
3. What are the advantage of using svc instead of init ?
parallelism
automatic restart
dependancy management
reporting
...
 
Old 03-30-2006, 12:51 AM   #5
linuxtesting2
Member
 
Registered: Mar 2004
Location: Norway
Distribution: Freebsd, Fedora, Redhat, Solaris 10
Posts: 169

Original Poster
Rep: Reputation: 30
i see....but it still not clear to me how to display the default runlevel, in Linux you have in the inittab file the "initdefault" setting...



Ole
 
Old 03-30-2006, 05:11 AM   #6
apt-get-dude
Member
 
Registered: Mar 2006
Posts: 98

Rep: Reputation: 15
is:3:initdefault used to be in /etc/inittab in solaris until 9. In solaris 10, like the happy "J" said, you are booting into a milestone technically, not a run level. All milestones are online when you boot without any options.

At the ok prompt, you can control which milestone you boot into by typing:
ok boot milestone=all (or single-user/multi-user/multi-user-server/none). Again,
the default is all.
 
Old 03-30-2006, 06:49 AM   #7
linuxtesting2
Member
 
Registered: Mar 2004
Location: Norway
Distribution: Freebsd, Fedora, Redhat, Solaris 10
Posts: 169

Original Poster
Rep: Reputation: 30
ok now im starting to get a hold of it...hehe.....thanks both..init has left fucked opp my brain


Ole
 
Old 03-31-2006, 05:27 AM   #8
apt-get-dude
Member
 
Registered: Mar 2006
Posts: 98

Rep: Reputation: 15
yep, it is a nice transition from legacy run levels to services. fun

You may want to play with services since this is the biggest difference between
10 and previous versions.

Some commands to play with...

svcs -a <- will show you all services and their states
svcadm enable service_name <- enable a service
svcadm disable service_name <- disable a service
svccfg -v import service_name <- import a service into the repository.db
svccfg delete service_name <- take out a service from the repository.db
Not: must be disabled first
svcprop service_name <- list the properties of a service
inetadm -d ftp <- disable ftp
inetadm -e ftp <- enable ftp
inetadm -l ftp <- see the properties of ftp
inetadm -m ftp tcp_trace=TRUE <- modify the tcp_trace property of ftp
inetadm -p <- view properties of inetd
inetadm -M tcp_wrappers=TRUE <- modify one of the inetd properties

These are just examples, have a ball !!!

Location of everything:

/etc/svc/repository.db <- name of the repository/database used for services
/lib/svc/method <- location of the scripts to be executed
/var/svc/manifest <- directory that holds manifests for services (xml files)

Try this for example:

# svccfg [enter]
> list <- list all the services
> select telnet <- select a specific service (telnet in this example)
> listprop <- list the properties of the service
> setprop property_name=value <- change one of the properties of the service
>
 
Old 08-29-2008, 06:04 AM   #9
WindowsIsFromSatan
LQ Newbie
 
Registered: Aug 2008
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by apt-get-dude View Post
is:3:initdefault used to be in /etc/inittab in solaris until 9. In solaris 10, like the happy "J" said, you are booting into a milestone technically, not a run level. All milestones are online when you boot without any options.

At the ok prompt, you can control which milestone you boot into by typing:
ok boot milestone=all (or single-user/multi-user/multi-user-server/none). Again,
the default is all.
Hello,

Concerning Solaris 10, I see that there is the /etc/inittab already there.
Do you agree that if the initdefault (set to a run level of 3) parameter is not in the inittab file, then server may not restart in multi-user mode?

I did an svcs -a on this Solaris 10 machine, and found that the milestones had nearly everything set to default.

You see, my problem is this: I need to configure this machine so that it reboots automatically in multi-user mode. It doesn't at present, and the missing initdefault line in the inittab is what makes me believe that. I checked the solaris documentation (docs.sun.com) and it still talks about the inittab, yet, when I do a man on inittab, the VERY last line tells me that the initdefault parameter is no longer accepted in the solaris10 OS, and that svcadm has replaced this.

So, how then do I make sure that svcadm restarts the server in multiusermode following an init 6 command?

Many thanks for your help.
 
Old 08-29-2008, 09:02 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
initdefault is no more used by Solaris code so setting it would have no effect outside a warning message telling it is ignored.

What makes you diagnose the OS not to be in multi-user mode ?
 
Old 08-29-2008, 09:28 AM   #11
WindowsIsFromSatan
LQ Newbie
 
Registered: Aug 2008
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by jlliagre View Post
initdefault is no more used by Solaris code so setting it would have no effect outside a warning message telling it is ignored.

What makes you diagnose the OS not to be in multi-user mode ?
Well, I did an svcs -a and found that the multi-user-server was disabled. I couldnt telnet in it.

I re-enabled it, and something very strange has been happening:

Despite it now being enabled, I cannot telnet to the box. I can only telnet from it. All telnet services are up.

What do you think the reason could be?
 
Old 08-29-2008, 10:03 AM   #12
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Can you telnet locally (telnet localhost) ?

What says "svcs -lp telnet" ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Solaris 10 SMF Configuration. Zepiroth Solaris / OpenSolaris 1 11-30-2005 06:19 AM
svc bad request dropping packet naveenrajn Linux - Networking 0 07-04-2005 04:22 AM
svc: bad direction *some number*, dropping request?? zovres Linux - Newbie 1 02-21-2004 11:22 AM
Svc needed for speech processing Stephanie Linux - General 1 08-05-2003 09:27 AM
SUSe email server hanging at postfix svc cmiwebmaster Linux - Newbie 0 04-14-2003 01:42 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 12:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration