Solaris / OpenSolarisThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Rep:
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.
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.
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Rep:
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.
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.
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.
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?
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Rep:
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.
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.
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.
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Rep:
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.
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?
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Rep:
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.