Solaris SMF-service file for starting/stopping TeamCity?

I'm trying to use TeamCity on a Solaris 10+ server.

Has anyone created a SMF manifest for TeamCity?


/Erik

2 comments
Comment actions Permalink

(Answering my own post as it might help other solaris users some day...)

I created a first draft for a solaris smf service for teamcity.

  • Teamcity should be installed in /opt/teamcity (or have a symlink from there)
  • A user with name/group teamcity/teamcity must exist and it's home directory must be writeable by user


Save xml as /var/svc/manifest/local/teamcity.xml (or what ever you like...) and import with:

$ svccfg import /var/svc/manifest/local/teamcity.xml

Start service with:

$ svcadm enable teamcity

Check if service has started:

$ svcs -xv

If there's no output, it worked. If it didn't work, the log from the service is at /var/svc/log/application-teamcity\:default.log.


/Erik

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--                                                                                                                               
    Manifest for Jetbrains TeamCity server                                                                                         
    Erik Tjernlund, 2009-01-15                                                                                      
-->

<service_bundle type='manifest' name='TeamCity Continuous Integration Server'>

<service name='application/teamcity' type='service' version='1'>

  <create_default_instance enabled='false'/>
  <single_instance/>

  <!-- Wait for network interfaces to be initialized -->
  <dependency name='network' grouping='require_all' restart_on='error' type='service'>
    <service_fmri value='svc:/milestone/network:default'/>
  </dependency>

  <!-- Wait for all local filesystems to be mounted -->
  <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
    <service_fmri value='svc:/system/filesystem/local:default'/>
  </dependency>

  <!-- Run as "teamcity" user and set environment variables -->
  <method_context>
    <method_credential user='teamcity' group='teamcity' privileges='basic'/>
    <method_environment>
      <envvar
         name='CATALINA_OPTS'
         value='-server -Xmx512m -XX:MaxPermSize=128m -Dlog4j.configuration=file:/opt/teamcity/conf/teamcity-server-log4j.x\
ml -Dteamcity_logs=/opt/teamcity/logs -Djava.awt.headless=true'/>
      <envvar
         name='CATALINA_HOME'
         value='/opt/teamcity'/>
    </method_environment>
  </method_context>

  <exec_method
     type='method'
     name='start'
     exec='/opt/teamcity/bin/catalina.sh %m'
     timeout_seconds='60'>
  </exec_method>
  <exec_method
     type='method'
     name='stop'
     exec='/opt/teamcity/bin/catalina.sh %m'
     timeout_seconds='60'>
  </exec_method>

  <stability value='Unstable'/>

  <template>
    <common_name>
      <loctext xml:lang='C'> TeamCity Continuous Integration Server</loctext>
    </common_name>
    <documentation>
      <doc_link name='TeamCity website' uri='http://www.jetbrains.com/teamcity/'/>
    </documentation>
  </template>

</service>
</service_bundle>


0
Comment actions Permalink

Erik, thanks a lot for your efforts!
This is an evidence of real community power for tools like TeamCity

Thanks again,
KIR

0

Please sign in to leave a comment.