Prior to GlassFish 3, the SMF service could be created with the following way:
# asadmin create-service –passwordfile /opt/SUNWappserver/glassfish/domains/domain1/passwordfile /opt/SUNWappserver/glassfish/domains/domain1
This no longer applies as the system informs me with the following message:
Deprecated syntax, instead use:
asadmin –passwordfile /opt/SUNWappserver/glassfish/domains/domain1/passwordfile create-service [options] …
The domain directory specified does not exist: /opt/SUNWappserver/glassfish/domains/opt/SUNWappserver/glassfish/domains/domain1
Usage: asadmin [asadmin-utility-options] create-service [–name ]
[–dry-run[=]] [–domaindir ]
Command create-service failed.
I edited the password file with the following information:
# vi /opt/SUNWappserver/glassfish/domains/domain1/passwordfile
Now the password file is in place, we can use the new syntax:
# asadmin –passwordfile /opt/SUNWappserver/glassfish/domains/domain1/passwordfile create-service domain1
The Service was created successfully. Here are the details:
Name of the service:application/GlassFish/domain1
Type of the service:Domain
Configuration location of the service:/opt/SUNWappserver/glassfish/domains
Manifest file location on the system:/var/svc/manifest/application/GlassFish/domain1_opt_SUNWappserver_glassfish_domains/Domain-service-smf.xml.
You have created the service but you need to start it yourself. Here are the most typical Solaris commands of interest:
* /usr/bin/svcs -a | grep domain1 // status
* /usr/sbin/svcadm enable domain1 // start
* /usr/sbin/svcadm disable domain1 // stop
* /usr/sbin/svccfg delete domain1 // uninstall
Command create-service executed successfully.
Great, let’s just start the service:
# svcadm enable svc:/application/GlassFish/domain1:default
# svcs -a | grep GlassFish
online 8:30:01 svc:/application/GlassFish/domain1:default
Indeed, the appserver was now managed by Solaris SMF.