OpenSolaris smf XML

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
jjarvis98
Newbie
Newbie
Posts: 1
Joined: June 10th, 2010, 2:26 am

OpenSolaris smf XML

Post by jjarvis98 »

This is my first attempt at this, but it's working so far.
Put:

Code: Select all

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
  <service name='network/sabnzbd' type='service' version='0'>
    <create_default_instance enabled='false'/>
    <single_instance/>
    <dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/system/filesystem/local'/>
    </dependency>
    <dependency name='fs-autofs' grouping='optional_all' restart_on='none' type='service'>
      <service_fmri value='svc:/system/filesystem/autofs'/>
    </dependency>
    <dependency name='net-loopback' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/network/loopback'/>
    </dependency>
    <dependency name='net-physical' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/network/physical'/>
    </dependency>
    <dependency name='nameservice' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/milestone/name-services'/>
    </dependency>
    <dependency name='network_ipfilter' grouping='optional_all' restart_on='error' type='service'>
      <service_fmri value='svc:/network/ipfilter:default'/>
    </dependency>
    <method_context>
      <method_credential group='other' user='dl'/>
      <method_environment>
        <envvar name='HOME' value='/export/home/dl'/>
        <envvar name='PATH' value='/opt/bin:/usr/bin:/bin'/>
      </method_environment>
    </method_context>
    <exec_method name='start' type='method' exec='/usr/bin/python2.6 /opt/sabnzbd/SABnzbd.py -b0 -f /export/home/dl/.sabnzbd/sabnzbd.ini' timeout_seconds='20'>
      <method_context working_directory='/export/home/dl'/>
    </exec_method>
    <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'/>
    <property_group name='startd' type='framework'>
      <propval name='ignore_error' type='astring' value='core,signal'/>
      <propval name='duration' type='astring' value='child'/>
    </property_group>
    <stability value='Unstable'/>
    <template>
      <common_name>
        <loctext xml:lang='C'>sabnzbd news reader</loctext>
      </common_name>
    </template>
  </service>
</service_bundle>
Into: /var/svc/manifest/site/sabnzbd.xml

Then:

Code: Select all

pfexec svccfg import /var/svc/manifest/site/sabnzbd.xml
This assumes a few things:
1) I'm running at user dl. (OS still only allows for 8 character user names!? It's downloader on my Ubuntu Box...)
2) The extracted download in in /opt/sabnzbd
3) I have the latest unrar and par2 in /opt/bin (Which is why I added the path.

Code: Select all

pfexec svcadm enable sabnzbd
to start.

Code: Select all

pfexec svcadm disable sabnzbd
to stop.

I always like doing things the "right way" on what ever OS I'm on... I'm sure this could be improved upon if anyone knows opensolaris.
Post Reply