Solaris 10 and later now supplies MySQL as part of the OS, provided you’ve installed the SUNWmysql[rtu] pkgs, but it’s started via a legacy RC script still. This document details how to create an SMF manifest to start MySQL instead.
Update: This process is only needed if you are running Solaris 10, or you wish to use the MySQL 4.x installation that is supplied with Nevada. Later builds of Nevada (I believe snv_79 and later) now come with MySQL 5.0 and includes a service manifest for this version.
1. Find all of the current RC scripts:
/etc/rc0.d/K00mysql
/etc/rc1.d/K00mysql
/etc/rc2.d/K00mysql
/etc/rc3.d/S99mysql
/etc/rcS.d/K00mysql
#
If you’ve never configured MySQL, you may find these don’t exist yet.
2. Remove all the old legacy scripts, if they exist.
3. Create the MySQL manifest (download):
# cp mysql.txt /var/svc/manifest/application/database/mysql.xml
If you’ve got Postgresql installed already, you’ll already have a /var/svc/manifest/application/database directory.
4. Import the manifest:
# svccfg import /var/svc/manifest/application/database/mysql.xml
5. Check the service:
STATE STIME FMRI
disabled 13:23:17 svc:/application/database/mysql:default
There you have it. Now to enable it, just ensure you’ve configured MySQL as per the README at /etc/sfw/mysql/README.solaris.mysql and then enable the service:
# svcs mysql
STATE STIME FMRI
online 13:29:14 svc:/application/database/mysql:default
3 Responses to “HOWTO: Convert MySQL RC Script to SMF Service”
Speak Your Mind 
Search
Related Entries
- MySQL Preferences Pane on OS X Leopard
- Site5 is Run By Children
- Outage This Morning
- Configure MySQL On Solaris 10
- HOWTO: Disable NFSv4 on RedHat Enterprise Linux 4
- SQL Injection Attack
- HOWTO: Dynamically Set IPFilter Rules for RPC Services
- Free Website Monitoring With mon.itor.us
- Sun to Buy MySQL
- Ultra Verbose patchadd(1M)


What about the creation of the mysql.xmls file
I provide a link to it above in step 3.
This is actually no longer needed on the later builds of Nevada as MySQL 5.0.45 is supplied and includes an SMF manifest. I’ve updated the post to reflect this.
Very nice and simple tutorial, thanks for sharing..