LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-01-2009, 06:28 AM   #1
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Rep: Reputation: 30
/etc/services


I have enable and disable some services in the /etc/services by comment and uncomment, e.g. #ftp, every time I want to make sure the configured parameter taking effect, what I do is to reboot again the OS. How to restart the services without rebooting the OS. Example, after I comment the ftp, then I issued the svcadm restart /network/ftp, it never take effect immediately, I still can ftp into the solaris, it only take effect when i reboot. Please help.
 
Old 04-01-2009, 06:38 AM   #2
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
Solaris 10's SMF works different than what you expect. If you want to disable a service, you must issue a:

Code:
# svcadm disable your-svc-fmri
The restart command does what it tells: restarts the service. To control internet style network services you should go with inetadm and svcadm, not editing the /etc/service by hand: that file establishes a relation between a service (name), a protocol and a port.
 
Old 04-01-2009, 06:41 AM   #3
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by crisostomo_enrico View Post
Solaris 10's SMF works different than what you expect. If you want to disable a service, you must issue a:

Code:
# svcadm disable your-svc-fmri
The restart command does what it tells: restarts the service. To control internet style network services you should go with inetadm and svcadm, not editing the /etc/service by hand: that file establishes a relation between a service (name), a protocol and a port.
Did this command able to restart the services after I edit the services file?

Code:
svcadm restart inetd
What you means by "not editing the /etc/service by hand"? The /etc/services file can't be edited? Any harm to the OS?

What are the different between svcadm and inetadm?

Last edited by Paris Heng; 04-01-2009 at 06:45 AM.
 
Old 04-01-2009, 07:00 AM   #4
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
If you want to stop a service, it's the disable command you've got to use. If you restart a service the service "restarts" and commenting out a line from the /etc/services file might not be sufficient for a service to stop. It could rather go into maintenance state, but disabling it is another thing.

inetd services are now managed with the SMF framework and so you should use the inetadm command to act upon them.

Try executing
Code:
# inetadm
and it'll give you output like this:
Code:
...
disabled  disabled       svc:/network/ftp:default
...
In your case, obviously, the ftp service may be running. If you want to disable it you could either run:
Code:
# inetadm -d svc:/network/ftp:default
or
Code:
# svcadm disable svc:/network/ftp:default
After that you could check either with inetadm or with svcs -a that the service has been stopped.

Quote:
The /etc/services file can't be edited? Any harm to the OS?
Editing /etc/services by hand is good, don't worry. What I meant is that stopping a service managed by SMF cannot and shouldn't be done altering its configuration files. Basic operations which you may be accostumed to see in Linux distros' startup scripts such as start, stop and refresh are managed by the SMF and the administrator interacts with it mainly by using svcadm. Some service manifests, for example, might establish a dependence with a configuration file which if doesn't exist, causes the service not to start. It was for example's sake.

Sorry if I update the entry but I was short of time. Another command which you should be aware of is netservices: you may find it in Solaris 10 and it's now been obsoleted. If you issue:
Code:
# netservice limited
citing its manpage:
Quote:
When netservices is invoked with the limited command-line
argument, all network services except the secure shell dae-
mon, sshd(1M), are either disabled or constrained to respond
to local requests only.

Last edited by crisostomo_enrico; 04-01-2009 at 08:32 AM.
 
Old 04-01-2009, 11:16 PM   #5
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by crisostomo_enrico View Post
If you want to stop a service, it's the disable command you've got to use. If you restart a service the service "restarts" and commenting out a line from the /etc/services file might not be sufficient for a service to stop. It could rather go into maintenance state, but disabling it is another thing.

inetd services are now managed with the SMF framework and so you should use the inetadm command to act upon them.

Try executing
Code:
# inetadm
and it'll give you output like this:
Code:
...
disabled  disabled       svc:/network/ftp:default
...
In your case, obviously, the ftp service may be running. If you want to disable it you could either run:
Code:
# inetadm -d svc:/network/ftp:default
or
Code:
# svcadm disable svc:/network/ftp:default
After that you could check either with inetadm or with svcs -a that the service has been stopped.


Editing /etc/services by hand is good, don't worry. What I meant is that stopping a service managed by SMF cannot and shouldn't be done altering its configuration files. Basic operations which you may be accostumed to see in Linux distros' startup scripts such as start, stop and refresh are managed by the SMF and the administrator interacts with it mainly by using svcadm. Some service manifests, for example, might establish a dependence with a configuration file which if doesn't exist, causes the service not to start. It was for example's sake.

Sorry if I update the entry but I was short of time. Another command which you should be aware of is netservices: you may find it in Solaris 10 and it's now been obsoleted. If you issue:
Code:
# netservice limited
citing its manpage:
Thanks for the explanation, did the netservices limited will affect the system startup?
 
Old 04-02-2009, 02:44 AM   #6
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
You're welcome!

Quote:
did the netservices limited will affect the system startup?
I don't exactly understand what you mean: after issuing the netservices limited command some running network services will be stopped leaving only ssh running. The obvious impact is that when you boot your system, the affected services will never be started. System functionality, besides stopped services, won't be limited.
 
Old 04-02-2009, 03:48 AM   #7
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
and some services will still start but will allow only local connections.
 
Old 05-09-2009, 12:13 AM   #8
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Any way to restart the /etc/services after I edit (comment and uncomment with #) the configuration file inside? Example like, #/etc/services restart? Anyway other way than reboot?

Last edited by Paris Heng; 05-09-2009 at 12:14 AM.
 
Old 05-09-2009, 04:23 AM   #9
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
I'm afraid you are confusing /etc/services and /etc/inetd.conf.

Neither in Solaris nor in Gnu/Linux /etc/services is used to enable/disable services. Its purpose is to match port numbers and services names.

If you want to disable ftp, simply run "svcadm disable ftp" as already explained. This takes effect immediately so there is no need to reboot.
 
Old 05-09-2009, 10:00 PM   #10
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jlliagre View Post
I'm afraid you are confusing /etc/services and /etc/inetd.conf.

Neither in Solaris nor in Gnu/Linux /etc/services is used to enable/disable services. Its purpose is to match port numbers and services names.

If you want to disable ftp, simply run "svcadm disable ftp" as already explained. This takes effect immediately so there is no need to reboot.
Yes, I get the full meaning here. But my situation now is, I have a comment #telnet 23 in /etc/services, and now I un-comment it. I afraid the matching port and the service name will not take effect without reoot. The svcadm telnet is running as well.

I wanna the telnet service to take effect without reboot after I edit the /etc/services. How can it to be done?

Last edited by Paris Heng; 05-09-2009 at 10:05 PM.
 
Old 05-09-2009, 11:33 PM   #11
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
I beg your pardon, Paris_Heng, but I'm really missing your point. Did you run the command we suggested? As soon as you disable a SMF-managed service, the service will be stopped. Without any reboot.
 
Old 05-10-2009, 11:34 AM   #12
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by crisostomo_enrico View Post
I beg your pardon, Paris_Heng, but I'm really missing your point. Did you run the command we suggested? As soon as you disable a SMF-managed service, the service will be stopped. Without any reboot.
Yeah, I did run the command and it works fine for me. What I means is when the telnet is commented in /etc/services, althought you are running svcadm enable telnet, it svcs will give you the result of MAINTENANCE instead of ONLINE. So, when I un-commented the telnet in /etc/services, did the svcs will give the result of ONLINE?
 
Old 05-10-2009, 05:24 PM   #13
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
After clearing its status, yes.

What's happening here could be discovered following these steps:
- inspect the service manifest in /var/svc/manifest/network/ftp.xml
- you'll see that it's ftp is an inetd-managed service and its start method is implemented by the in.ftpd executable file
- man page for in.ftpd tells you that it discovers the listening port by examining the services file and that's what it's complaining for, probably.

By the way, you should examine svcs -xv output to discover why the service was put in maintenance mode.

Hope this helps,
Enrico
 
Old 05-11-2009, 07:27 AM   #14
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
In /etc/services file define port and corresponding services(say example in default http listening port80), But this smf facility is helping you to manage the services(stop and start the services), i think you dont want to confuse with these /etc/service and smf
 
  


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
services-admin/Services deardron Ubuntu 7 09-22-2006 08:32 PM
Media Services on Linux platform similar to Windows Media Services happyok Linux - Software 3 05-27-2006 04:36 PM
what are all services? alaios Linux - Security 4 10-31-2004 12:08 PM
TightVNC Ver terminal Services.. also looking for terminal Services for linux 2782d4 Linux - Security 3 05-20-2004 02:30 AM
Services floyd Linux - Software 1 05-17-2004 09:14 AM

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

All times are GMT -5. The time now is 07:21 PM.

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