named service in Solaris 10
Posted: Wed Feb 25, 2009 8:18 pm
Two key files: /lib/svc/method/dns-server and /var/svc/manifest/network/dns/server.xml.
Now fix the permissions for the two files created:
Import the service into the service repository:
Enable the service:
Created a new script (named) in /etc/init.d.
Disable S53named in /etc/rc3.d by renaming it to s53named (the difference is the uppercase and lowercase "S" vs "s"). Lowering it to lowercase "s" prevents the system to start this legacy service.
I did modify /lib/svc/method/dns-server to reflect the correct path of named.
From (non-existence):
To (BIND 9.5.0-P2):
Non-Global Zones
For non-global zones, I need to copy /var/svc/manifest/network/dns/server.xml to each NGZ, for each NGZ has its own /var. On the other hand, /lib is inherited from global zone and therefore /lib/svc/method/dns-server is already in place.
/etc/init.d/named needs to be added as well in each NGZ.
Now fix the permissions for the two files created:
Code: Select all
%chown root:bin /lib/svc/method/dns-server
%chmod 555 /lib/svc/method/dns-server
%chown root:sys /var/svc/manifest/network/dns/server.xml
%chmod 444 /var/svc/manifest/network/dns/server.xml
Code: Select all
%svccfg import /var/svc/manifest/network/dns/server.xml
Code: Select all
%svcadm -v enable dns/server:default
Code: Select all
%svcs -v dns/server
STATE NSTATE STIME CTID FMRI
online - 20:03:20 2701 svc:/network/dns/server:default
Code: Select all
#!/sbin/sh
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "@(#)named 1.0 02/25/2009 CAH
# This service is managed by smf(5). Thus, this script provides
# compatibility with previously documented init.d script behaviour.
case "$1" in
'restart')
# The previous init.d/sendmail restart behaviour matches
# the smf(5) 'refresh' semantics.
svcadm refresh dns/server:default
;;
'start')
svcadm enable -t dns/server:default
;;
'stop')
svcadm disable -t dns/server:default
;;
*)
echo "Usage: $0 { start | stop | restart }"
exit 1
;;
esac
I did modify /lib/svc/method/dns-server to reflect the correct path of named.
From (non-existence):
Code: Select all
server="/usr/sbin/named"
Code: Select all
server="/usr/local/sbin/named"
For non-global zones, I need to copy /var/svc/manifest/network/dns/server.xml to each NGZ, for each NGZ has its own /var. On the other hand, /lib is inherited from global zone and therefore /lib/svc/method/dns-server is already in place.
/etc/init.d/named needs to be added as well in each NGZ.
PS wrote: The reason of creating this service is the legacy startup script for named in global zone stops all named processes (including named processes in NGZs) when it executes the pkill command. It simply kills all named processes from global zone by root.
Strangely enough, this service should be included by default (office Solaris 10 x86 has it in place) but I couldn't find related xml file and method on hsiao.net. I had to copy from one of the office servers. My guess is, I did not install the DNS package when installed Solaris 10 OS.