On Oracle Solaris 10, you can use the asadmin create-service subcommand to create an Oracle Solaris Service Management Facility (SMF) service that restarts a DAS. The service grants to the process the privileges of the user that runs the process. When you create an SMF service, the default user is the superuser. If you require a different user to run the process, specify the user in method_credential.
If your process is to bind to a privileged port of Oracle Solaris 10, the process requires the net_privaddr privilege. The privileged ports of the Oracle Solaris operating system have port numbers less than 1024.
To determine if a user has the net_privaddr privilege, log in as that user and type the command ppriv -l | grep net_privaddr.
After you create and enable the SMF service, if the domain goes down, SMF restarts it.
To run the asadmin create-service subcommand, you must have solaris.smf.* authorization. See the useradd and usermod man pages to find out how to set the authorizations. You must also have write permission in the directory tree: /var/svc/manifest/application/SUNWappserver. Usually, the superuser has both of these permissions. Additionally, Oracle Solaris 10 administration commands such as svccfg, svcs, and auths must be available in the PATH.
If a particular GlassFish Server domain should not have default user privileges, modify the manifest of the service and reimport the service.
Create the service by using the create-service(1) subcommand.
After the service is created, enable the service by using the svacdm enable command.
For example:
svacdm enable /appserver/domains/domain1 |
This example creates a service for the default domain on a system that is running Oracle Solaris.
asadmin> create-service 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:/home/gfuser/glassfish-installations /glassfishv3/glassfish/domains Manifest file location on the system:/var/svc/manifest/application /GlassFish/domain1_home_gfuser_glassfish-installations_glassfishv3 _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 |
As you administer your service, the following Oracle Solaris commands are useful: auths, smf_security, svcadm, svccfg, rbac, useradd, and usermod.