Today I’ve been fighting with Solaris 10 and the SMF Manifest (others would call it init-script …). Since I wanted to do it the proper way (I could have used a “old-style” init-script, but I didn’t wanna ..), I ended up combing the interweb for examples .. As it turns out, not even IBM has documented a way, on how to do this.

In the end this is what I’ve come up with:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>

<!--
  mkdir /var/svc/manifest/application/dsmc
  chmod 755 /var/svc/manifest/application/dsmc
  chown root:bin /var/svc/manifest/application/dsmc
  <den inhalt dieser datei per vi nach /var/svc/manifest/application/dsmc/dsmc.xml importieren
  svcadm -v import /var/svc/manifest/application/dsmc/dsmc.xml
  svcadm enable application/dsmc

-->
<service_bundle type='manifest' name='TIVsmCba:dsmc'>
  <service name='application/dsmc' type='service' version='0'>
    <create_default_instance enabled='true'/>
    <single_instance/>

    <dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/system/filesystem/local'/>
    </dependency>
    <dependency name='net-physical' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/network/physical'/>
    </dependency>

    <exec_method name='start' type='method' exec='/opt/tivoli/tsm/client/ba/bin/dsmc.helper' timeout_seconds='60'>
      <method_context working_directory='/opt/tivoli/tsm/client/ba/bin'/>
    </exec_method>
    <exec_method name='stop' type='method' exec='/usr/bin/pkill dsmc' timeout_seconds='60'>
      <method_context/>
    </exec_method>

    <stability value='Unstable'/>
    <template>
      <common_name>
        <loctext xml:lang='C'>Tivoli Storage Manager Client Scheduler</loctext>
      </common_name>
    </template>
  </service>
</service_bundle>

However, in order to get the scheduler client working on Solaris, I had to create a little helper script in /opt/tivoli/tsm/client/ba/bin named dsmc.helper:

1
2
3
4
5
6
7
#!/bin/bash

export DSM_DIR="/opt/tivoli/tsm/client/ba/bin"
export DSM_LOG="/opt/tivoli/tsm/client/ba/bin"
export DSM_CONFIG="/usr/bin/dsm.opt"

$DSM_DIR/dsmc sched &>/dev/null &

With that, I was able to automate the TSM Scheduler Client startup on Solaris.