In an SMF method command, :kill
simply means .... well just that. Same effect as executing a kill
command from from the shell, except SMF makes sure that is is the contract which is killed, i.e. all processes of the contract dies.
You can read about :kill
in the man page for "smf_method"
If you don't specify any
<exec_method type='method' name='stop' ..../>
at all in your manifest then SMF will use :kill -SIGTERM
as the stop command. This works for many services. So often you can have a very simple SMF manifest that doesn't require a lot of lines.
However, there are cases where you may want a more elaborate stop method and in that case you'll have to code your own. Your's is not such a case. Your example simply uses kill
so it does nothing than SMF wouldn't do on its own. You don't need it !
Some examples spring to mind of scenarios where you many want to use an explicit 'stop' method:
The service brings with it its own start/stop/restart script. In that
case better to use that unless you understand that what it does is
trivial and may as well be handled by SMF.
The service has an alternative shutdown method that allows it to
cleanly shut down. For example Tomcat opens a listening port on
localhost and when you send the text "SHUTDOWN" to that port then
Tomcat will shut down cleanly.
The service may not always react to a kill command. It may need a
harsher method such as first executing kill
(nice kill) and if that
didn't kill the process after X seconds then an kill -9
should be
attempted.