I need to create my own manifest XML script and establish service to
run the following RC script "S100nddarpip" in /etc/rc3.d directory.
Unfortunately, I am getting errors when trying to import the xml file,
even though the script validates OK. Could anyone shed some light on
what is wrong in the XML file and how to get rid of the error
messages ? Thanks, Bill
# cat /etc/rc3.d/S100nddarpip
ndd -set /dev/arp arp_cleanup_interval 60000
ndd -set /dev/ip ip_ire_arp_interval 60000
# cat /var/svc/manifest/site/ndd.xml
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/
service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
<service name='system/ndd' type='service' version='0'>
<create_default_instance enabled='true'/>
<single_instance/>
<exec_method name='start' type='method' exec='/etc/rc3.d/
S100nddarpip' timeout_seconds='60'>
<method_context/>
</exec_method>
<exec_method name='stop' type='method' exec=':kill'
timeout_seconds='60'>
<method_context/>
</exec_method>
</service>
</service_bundle>
# svccfg validate ndd.xml
#
# svccfg -v import ndd.xml
svccfg: Temporary service "TEMP/system/ndd" must be deleted before
this manifest can be imported.
svccfg: Import of ndd.xml failed. Progress:
svccfg: Service "system/ndd": not reached.
svccfg: Instance "default": not reached.
First, you're getting an error that you need to delete TEMP/system/ndd
first. Do that.
# svccfg delete TEMP/system/ndd
Second, if you *really* want to make this an SMF service, move the
script out of the rc3.d directory (or it will run twice) and put the
following in your manifest:
<property_group name='startd' type='framework'>
<propval name='duration' type='astring'
value='transient' />
</property_group>
If you don't SMF will probably keep trying to restart the ndd script
each time it exits, which is not what you want. (see the svc.startd
man page for more info on that).
Personally, I don't think there is any benefit to running an 'ndd'
script as an SMF serviceat all. All you need to do is put your rc
script in place in /etc/rc3.d/S100nddarpip (which you've already
done). Each time the system boots, it will load SMF services and then
legacy init scripts (which is what you have). Don't even worry about
svccfg or importing a manifest - you don't need it in this case.
Normally, you would just execute an ndd command at boot, and never
again after that. In this case, it's a good candidate to be run as a
legacy script. SMF is really useful in cases when you have a daemon
process that you need to start up and keep running. SMF can
automatically restart those processes if they go down. SMF also helps
if your service has important dependencies that need to be in place
before it runs. Your script doesn't seem to need these features.
Also, if you want your init script to run last, naming it
"S100nddarpip" won't accomplish that. S100... would be executed first,
most likely. If you want to see what order the scripts will run in,
simply cd to /etc/rc3.d and run 'ls -1'. The order that the scripts
are listed is the same order that they will run. If you want to make
sure it runs last, best to name it "S99nddarpip" or something like
that.
__Jason