Technical Tip

QUESTION

How do I create a new inetd on-demand service in Solaris 10?

ANSWER
inetd in Solaris 10 has changed, with all inetd services now controlled under the SMF (Service Management
Facility). General service management is controlled via the svcadm command, but a special command called inetadm is provided to manage network services, together with inetconv to assist in adding further inetd-style services.
For a full run-down on SMF. svcadm, etc, please attend our Solaris 10 Administration courses, but here
is an example of adding an inetd-style service using the Samba swat tool:-
(Note that this is a little outdated now as swat has already been "SMF'd" in Solaris 10 U4 8/07 - however the example
is still handy!)

First, add an entry in /etc/services for swat:-
swat            901/tcp

Next, create a file containing a valid inted.conf-style entry for swat, for example /inet.swat:-
swat   stream   tcp   nowait   root   /usr/sfw/sbin/swat   swat

Now run inetconv as follows:-
# inetconv  -i  /inet.swat
swat -> /var/svc/manifest/network/swat-tcp.xml
Importing swat-tcp.xml ...Done

Now swat can be enabled (Note the service name):-
inetadm -e svc:/network/swat/tcp:default

List the service as follows:-
# inetadm   -l   svc:/network/swat/tcp:default
inetadm -l svc:/network/swat/tcp:default
SCOPE    NAME=VALUE
         name="swat"
         endpoint_type="stream"
         proto="tcp"
         isrpc=FALSE
         wait=FALSE
         exec="/usr/sfw/sbin/swat"
etc.etc..
You can now connect to swat via your web browser on port 901, for example https://localhost:901
Note that Samba is not enabled on Solaris 10 by default, look in /etc/sfw for an example smb.conf file.
Note also that on Solaris 10 U3 and previously Samba runs as a legacy service, so is started by SMF, but then SMF provides no further control.
To enable Samba, manually run "/etc/init.d/samba start" (Once you have a working /etc/sfw/smb.conf file - see smb.conf examples for some ideas)
On U4 and later, the Samba configuration file is the same, but start the service like this:-
# svcadm  enable  samba

We hope this has been a useful tip, see below for additional notes
Mick Hosegood - First Alternative.

NOTES

First Alternative course tutors can answer questions like this ... and are happy to do so. Look around our site for relevant courses in Linux -Unix - Perl - Solaris - FrameMaker

close window