If you are are Slim Devices fan (easily the best home MP3 device on the market), you can run the software quite nicely on Solaris. The SlimServer software is written in Perl - so it runs on almost anything. However - there are a couple of Perl modules that require a C compiler to install. You can do some hacking and use gcc, but your best bet is download the Studio 11 compilers (the default Perl makefiles assume you are using the Sun C compiler).

Here is a service manifest that I hacked together for starting SlimServer ( I am a SMF newbie, so feel free to offer improvements :-)

[Update: Thanks to tips from Stephen and Dave, the associated service method is no longer required. The process can be directly started with the exec method - and :kill can be used to shut it down].



<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='slimserver'>
  <service name='application/slimserver' type='service' version='1'>
        <create_default_instance enabled='false'/>
        <single_instance/>
<dependency name='name-services' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/milestone/name-services' />
</dependency>
<dependency name='network' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/milestone/network' />
</dependency>
<dependency
name='local-filesystems' type='service' restart_on='none'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
        <exec_method type='method' name='start'
                exec='/usr/local/slimserver/slimserver.pl -daemon'
                timeout_seconds='30' />
        <exec_method type='method' name='stop'
         exec=':kill'
                timeout_seconds='30' />
        <stability value='Unstable' />
        <template>
               <common_name>
                        <loctext xml:lang='C'>Slim Server</loctext>
                </common_name>
                <documentation>
                        <doc_link name='SlimDevices Home'
                                uri='http://www.slimdevices.com/' />

                 uri='http://www.slimdevices.com/' />
                </documentation>
        </template>
  </service>
</service_bundle>
Comments:

Nice. I recommend changing your stop method to ":kill"; otherwise, your current implementation may kill slimserver instances running in non-global zones (if run in the global zone). This change means that your method script can be simplified to being start only. (That is, no case statement.) &mdash; Stephen

Posted by Stephen on December 12, 2005 at 11:17 AM MST #

Even more, you don't really need the script. I'd written a manifest myself a while back which I hadn't published, but as Stephen suggested, just use :kill as the stop method and, additionally, invoke the perl directly as the start method, e.g.: exec='/usr/local/slimserver/slimserver.pl --daemon' Start scripts are so 80's ;-)

Posted by Dave Miner on December 14, 2005 at 09:40 AM MST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by warren