Creating SMF services
This time, we are going to create a new service in Oracle Solaris 11, and the chosen application is gedit, which is a graphical editor. It is obvious that we can show the same procedure using any application and we will only need to make the necessary alterations to adapt the example.
Getting ready
This recipe requires a virtual machine (VirtualBox or VMware) with Oracle Solaris 11 installed and 4 GB RAM.
How to do it…
The first step is to create a script that starts and stops the application that we are interested in. There are several scripts in /lib/svc/method
and we could use one of them as a template, but I have used a very basic model, as follows:
root@solaris11-1:~/chapter5# vi gedit_script.sh #!/sbin/sh . /lib/svc/share/smf_include.sh ...
Get Oracle Solaris 11 Advanced Administration Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.