svcbundle is a really useful tool to create SMF manifests without having to hassle too much with XML. Most often you don’t have to work with XML at all, but there were some gaps where you weren’t able to use some options that SMF offers with a non-edited manifest generated by svcbundle because the -s option simply did not support this parameter. svcbundle was simply never thought of as a full substitute for vi and some knowledge of every thinkable use case of an SMF manifest.
Solaris 11 SRU 27 closed some of the gaps. You can now define a jitter and delay for a periodic service. I will write a blog entry about those options later.
However you can now define a timeout value for the methods. This blog entry is about this addition. Per default it would use a timeout of 60 seconds, but with -s timeout= you can set it for all methods to a value of your preference. When using -s timeout the timeout is the same for all methods. This was one of the parts which I most often edited manually after working with svcbundle. The other one will be addressed by a blog entry in a few days.
# svcbundle -s service-name=site/narf \
-s start-method="/lib/svc/method/narf %m" \
-s stop-method="/lib/svc/method/narf %m" \
-s refresh-method="/lib/svc/method/narf %m" \
-s model=daemon -s timeout=30
[...]
<exec_method name="start" type="method" timeout_seconds="30"
exec="/lib/svc/method/narf %m"/>
<exec_method name="stop" type="method" timeout_seconds="30"
exec="/lib/svc/method/narf %m"/>
<exec_method name="refresh" type="method" timeout_seconds="30"
exec="/lib/svc/method/narf %m"/>
However sometimes you just want to set a certain timeout for one of your methods, for example because the start script takes longer and you want a timeout longer than the refresh timeout which may be just a SIGHUP to a process. You can now specify method-specific timeouts via svcbundle with -s start-timeout=, -s stop-timeout= and -s refresh-timeout=:
# svcbundle -s service-name=site/narf \
-s start-method="/lib/svc/method/narf %m" \
-s stop-method="/lib/svc/method/narf %m" \
-s refresh-method="/lib/svc/method/narf %m" \
-s model=daemon \
-s start-timeout=30 -s stop-timeout=20 -s refresh-timeout=10
[...]
<exec_method name="start" type="method" timeout_seconds="30"
exec="/lib/svc/method/narf %m"/>
<exec_method name="stop" type="method" timeout_seconds="20"
exec="/lib/svc/method/narf %m"/>
<exec_method name="refresh" type="method" timeout_seconds="10"
exec="/lib/svc/method/narf %m"/>