11 February 2008

Manage services under Solaris

A simple refresh of what can be done with svcs and svcadm tools.

Get list of all services:
svcs

Add a service:
To begin, a manifest file is needed to define the service (some information there).
Then, it is needed to ensure it is valid:
xmllint --valid /path/to/my/service/manifest/file

Finally, the service can be add:
svccfg import /path/to/my/service/manifest/file

Activate a service (which has been priorly added):
svcadm enable * serviceName
The -s option can be used to get focus only after the service is fully activated (or failed).

Disable a service:
svcadm disable * serviceName
The -s option can be used to get focus only after the service has been disabled.

Put a service under maintenance:
svcadm mark * serviceName

Remove the "maintenance" status of a service:
svcadm clear * serviceName

Update the configuration of a service:
svcadm refresh * serviceName

Get the current status of a service:
svcs -x serviceName stop

No comments:

Post a Comment

Thank you for your visit, let's share your point of view: