Index: trunk/tools/smf/confluence.xml |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='confluence'> |
| 7 | + <service name='application/confluence' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' |
| 19 | + exec='/opt/wmf/smf/method-confluence %m' |
| 20 | + timeout_seconds='60'> |
| 21 | + <method_context> |
| 22 | + <method_credential user='confluence' /> |
| 23 | + </method_context> |
| 24 | + </exec_method> |
| 25 | + |
| 26 | + <exec_method type='method' name='stop' exec='/opt/wmf/smf/method-confluence %m' timeout_seconds='60'> |
| 27 | + <method_context> |
| 28 | + <method_credential user='confluence' /> |
| 29 | + </method_context> |
| 30 | + </exec_method> |
| 31 | + |
| 32 | + <property_group name='startd' type='framework'> |
| 33 | + <propval name='duration' type='astring' value='transient' /> |
| 34 | + </property_group> |
| 35 | + |
| 36 | + <template> |
| 37 | + <common_name><loctext xml:lang='C'>Confluence</loctext></common_name> |
| 38 | + </template> |
| 39 | + </service> |
| 40 | +</service_bundle> |
Index: trunk/tools/smf/sshtunnel.xml |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='sshtunnel'> |
| 7 | + <service name='network/sshtunnel' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' exec='/opt/wmf/smf/method-sshtunnel %m' timeout_seconds='60'> |
| 19 | + </exec_method> |
| 20 | + |
| 21 | + <exec_method type='method' name='stop' exec=':kill' timeout_seconds='60'> |
| 22 | + </exec_method> |
| 23 | + |
| 24 | + <property_group name='startd' type='framework'> |
| 25 | + <propval name='duration' type='astring' value='child' /> |
| 26 | + </property_group> |
| 27 | + |
| 28 | + <property_group name='tunnel' type='application'> |
| 29 | + <propval name='local-port' type='integer' value='0' /> |
| 30 | + <propval name='remote-port' type='integer' value='0' /> |
| 31 | + <propval name='remote-host' type='astring' value='' /> |
| 32 | + </property_group> |
| 33 | + |
| 34 | + <template> |
| 35 | + <common_name><loctext xml:lang='C'>SSH tunnel</loctext></common_name> |
| 36 | + </template> |
| 37 | + </service> |
| 38 | +</service_bundle> |
Index: trunk/tools/smf/method-php-fastcgi |
— | — | @@ -0,0 +1,34 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +. /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +PHP_FCGI_CHILDREN=`getproparg fastcgi/children` |
| 12 | +PHP_FCGI_MAX_REQUESTS=`getproparg fastcgi/max-requests` |
| 13 | +bindaddr=`getproparg fastcgi/bind-address` |
| 14 | +phpini=`getproparg fastcgi/php-ini-path` |
| 15 | + |
| 16 | +[[ ! -z "$PHP_FCGI_CHILDREN" ]] && export PHP_FCGI_CHILDREN |
| 17 | +[[ ! -z "$PHP_FCGI_MAX_REQUESTS" ]] && export PHP_FCGI_MAX_REQUESTS |
| 18 | + |
| 19 | +[[ -z "$bindaddr" ]] && { |
| 20 | + echo >&2 "fastcgi/bind-address not set" |
| 21 | + exit 1 |
| 22 | +} |
| 23 | + |
| 24 | +args="" |
| 25 | +[[ ! -z "$phpini" ]] && args="$args -c $phpini" |
| 26 | + |
| 27 | +case "$1" in |
| 28 | + start) |
| 29 | + /opt/php/bin/php-cgi -b $bindaddr $args & |
| 30 | + ;; |
| 31 | + *) |
| 32 | + echo >&2 "usage: $0 start" |
| 33 | + exit 1 |
| 34 | + ;; |
| 35 | +esac |
Index: trunk/tools/smf/method-supybot |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +. /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +config=`getproparg supybot/config-file` |
| 12 | + |
| 13 | +[[ -z "$config" ]] && { |
| 14 | + echo >&2 "supybot/config-file property is not set" |
| 15 | + exit 1 |
| 16 | +} |
| 17 | + |
| 18 | +case "$1" in |
| 19 | + start) |
| 20 | + /usr/bin/supybot -d $config |
| 21 | + ;; |
| 22 | + *) |
| 23 | + echo >&2 "usage: $0 start" |
| 24 | + exit 1 |
| 25 | + ;; |
| 26 | +esac |
Index: trunk/tools/smf/jira.xml |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='jira'> |
| 7 | + <service name='application/jira' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' |
| 19 | + exec='/opt/wmf/smf/method-jira %m' |
| 20 | + timeout_seconds='60'> |
| 21 | + <method_context> |
| 22 | + <method_credential user='jira' /> |
| 23 | + </method_context> |
| 24 | + </exec_method> |
| 25 | + |
| 26 | + <exec_method type='method' name='stop' exec='/opt/wmf/smf/method-jira %m' timeout_seconds='60'> |
| 27 | + <method_context> |
| 28 | + <method_credential user='jira' /> |
| 29 | + </method_context> |
| 30 | + </exec_method> |
| 31 | + |
| 32 | + <property_group name='startd' type='framework'> |
| 33 | + <propval name='duration' type='astring' value='transient' /> |
| 34 | + </property_group> |
| 35 | + |
| 36 | + <template> |
| 37 | + <common_name><loctext xml:lang='C'>JIRA</loctext></common_name> |
| 38 | + </template> |
| 39 | + </service> |
| 40 | +</service_bundle> |
Index: trunk/tools/smf/method-memcached |
— | — | @@ -0,0 +1,35 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +. /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +memlimit=`getproparg memcached/memory-limit` |
| 12 | +listenaddress=`getproparg 2>/dev/null memcached/listen-address` |
| 13 | +tcpport=`getproparg 2>/dev/null memcached/tcp-port` |
| 14 | +udpport=`getproparg 2>/dev/null memcached/udp-port` |
| 15 | +socket=`getproparg 2>/dev/null memcached/socket-path` |
| 16 | + |
| 17 | +[[ -z "$memlimit" ]] && { |
| 18 | + echo >&2 "memcached/memory-limit not set" |
| 19 | + exit 1 |
| 20 | +} |
| 21 | + |
| 22 | +args="-d -m $memlimit" |
| 23 | +[[ ! -z "$tcpport" ]] && args="$args -p $tcpport" |
| 24 | +[[ ! -z "$udpport" ]] && args="$args -U $tcpport" |
| 25 | +[[ ! -z "$socket" ]] && args="$args -s $tcpport" |
| 26 | +[[ ! -z "$listenaddress" ]] && args="$args -l $listenaddress" |
| 27 | + |
| 28 | +case "$1" in |
| 29 | + start) |
| 30 | + /usr/local/bin/memcached $args |
| 31 | + ;; |
| 32 | + *) |
| 33 | + echo >&2 "usage: $0 start" |
| 34 | + exit 1 |
| 35 | + ;; |
| 36 | +esac |
Index: trunk/tools/smf/method-hq-server |
— | — | @@ -0,0 +1,31 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +. /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +installdir=`getproparg hq/install-dir` |
| 12 | + |
| 13 | +[[ -z "$installdir" ]] && { |
| 14 | + echo >&2 "hq/install-dir property is not set" |
| 15 | + exit 1 |
| 16 | +} |
| 17 | + |
| 18 | +JAVA_HOME=/usr/java |
| 19 | +export JAVA_HOME |
| 20 | + |
| 21 | +case "$1" in |
| 22 | + start) |
| 23 | + cd $installdir && bin/hq-server.sh start |
| 24 | + ;; |
| 25 | + stop) |
| 26 | + cd $installdir && bin/hq-server.sh stop |
| 27 | + ;; |
| 28 | + *) |
| 29 | + echo >&2 "usage: $0 <start|stop>" |
| 30 | + exit 1 |
| 31 | + ;; |
| 32 | +esac |
Index: trunk/tools/smf/msgbot.xml |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='msgbot'> |
| 7 | + <service name='application/msgbot' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' |
| 19 | + exec='/opt/wmf/smf/method-msgbot %m' |
| 20 | + timeout_seconds='60'> |
| 21 | + <method_context> |
| 22 | + <method_credential user='msgbot' /> |
| 23 | + </method_context> |
| 24 | + |
| 25 | + </exec_method> |
| 26 | + |
| 27 | + <exec_method type='method' name='stop' exec=':kill' timeout_seconds='60'> |
| 28 | + </exec_method> |
| 29 | + |
| 30 | + <property_group name='startd' type='framework'> |
| 31 | + <propval name='duration' type='astring' value='transient' /> |
| 32 | + </property_group> |
| 33 | + |
| 34 | + <template> |
| 35 | + <common_name><loctext xml:lang='C'>IRC message relay bot</loctext></common_name> |
| 36 | + </template> |
| 37 | + </service> |
| 38 | +</service_bundle> |
Index: trunk/tools/smf/fisheye.xml |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='fisheye'> |
| 7 | + <service name='application/fisheye' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' |
| 19 | + exec='/opt/wmf/smf/method-fisheye %m' |
| 20 | + timeout_seconds='60'> |
| 21 | + <method_context> |
| 22 | + <method_credential user='fisheye' /> |
| 23 | + </method_context> |
| 24 | + </exec_method> |
| 25 | + |
| 26 | + <exec_method type='method' name='stop' exec='/opt/wmf/smf/method-fisheye %m' timeout_seconds='60'> |
| 27 | + <method_context> |
| 28 | + <method_credential user='fisheye' /> |
| 29 | + </method_context> |
| 30 | + </exec_method> |
| 31 | + |
| 32 | + <property_group name='startd' type='framework'> |
| 33 | + <propval name='duration' type='astring' value='transient' /> |
| 34 | + </property_group> |
| 35 | + |
| 36 | + <template> |
| 37 | + <common_name><loctext xml:lang='C'>FishEye</loctext></common_name> |
| 38 | + </template> |
| 39 | + </service> |
| 40 | +</service_bundle> |
Index: trunk/tools/smf/method-confluence |
— | — | @@ -0,0 +1,31 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +. /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +confdir=`getproparg confluence/install-dir` |
| 12 | + |
| 13 | +[[ -z "$confdir" ]] && { |
| 14 | + echo >&2 "confluence/install-dir property is not set" |
| 15 | + exit 1 |
| 16 | +} |
| 17 | + |
| 18 | +JAVA_HOME=/usr/java |
| 19 | +export JAVA_HOME |
| 20 | + |
| 21 | +case "$1" in |
| 22 | + start) |
| 23 | + cd $confdir && bin/startup.sh |
| 24 | + ;; |
| 25 | + stop) |
| 26 | + cd $confdir && bin/shutdown.sh |
| 27 | + ;; |
| 28 | + *) |
| 29 | + echo >&2 "usage: $0 <start|stop>" |
| 30 | + exit 1 |
| 31 | + ;; |
| 32 | +esac |
Index: trunk/tools/smf/method-sshtunnel |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | + . /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +localport=`getproparg tunnel/local-port` |
| 12 | +remoteport=`getproparg tunnel/remote-port` |
| 13 | +remotehost=`getproparg tunnel/remote-host` |
| 14 | + |
| 15 | +while true; do |
| 16 | + ssh -Cni /usr/local/etc/id_dsa_pppuser \ |
| 17 | + -L$localport:$remotehost:$remoteport \ |
| 18 | + -cblowfish-cbc \ |
| 19 | + -n -N \ |
| 20 | + pppuser@browne.wikimedia.org |
| 21 | + |
| 22 | + # Transitory network problem? |
| 23 | + sleep 5 |
| 24 | +done |
| 25 | + |
| 26 | +exit 0 |
Property changes on: trunk/tools/smf/method-sshtunnel |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/tools/smf/method-jira |
— | — | @@ -0,0 +1,31 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +. /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +jiradir=`getproparg jira/install-dir` |
| 12 | + |
| 13 | +[[ -z "$jiradir" ]] && { |
| 14 | + echo >&2 "jira/install-dir property is not set" |
| 15 | + exit 1 |
| 16 | +} |
| 17 | + |
| 18 | +JAVA_HOME=/usr/java |
| 19 | +export JAVA_HOME |
| 20 | + |
| 21 | +case "$1" in |
| 22 | + start) |
| 23 | + cd $jiradir && bin/startup.sh |
| 24 | + ;; |
| 25 | + stop) |
| 26 | + cd $jiradir && bin/shutdown.sh |
| 27 | + ;; |
| 28 | + *) |
| 29 | + echo >&2 "usage: $0 <start|stop>" |
| 30 | + exit 1 |
| 31 | + ;; |
| 32 | +esac |
Index: trunk/tools/smf/supybot.xml |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='supybot'> |
| 7 | + <service name='application/supybot' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' |
| 19 | + exec='/opt/wmf/smf/method-supybot %m' |
| 20 | + timeout_seconds='60'> |
| 21 | + </exec_method> |
| 22 | + |
| 23 | + <exec_method type='method' name='stop' exec=':kill' timeout_seconds='60'> |
| 24 | + </exec_method> |
| 25 | + |
| 26 | + <instance name='tsbot' enabled='false'> |
| 27 | + |
| 28 | + <method_context> |
| 29 | + <method_credential user='tsbot' /> |
| 30 | + </method_context> |
| 31 | + |
| 32 | + <property_group name='startd' type='framework'> |
| 33 | + <propval name='duration' type='astring' value='transient' /> |
| 34 | + </property_group> |
| 35 | + |
| 36 | + </instance> |
| 37 | + |
| 38 | + <template> |
| 39 | + <common_name><loctext xml:lang='C'>Supybot</loctext></common_name> |
| 40 | + </template> |
| 41 | + </service> |
| 42 | +</service_bundle> |
Index: trunk/tools/smf/php-fastcgi.xml |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='php:fastcgi'> |
| 7 | + <service name='application/php-fastcgi' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' |
| 19 | + exec='/opt/wmf/smf/method-php-fastcgi %m' |
| 20 | + timeout_seconds='60'> |
| 21 | + </exec_method> |
| 22 | + |
| 23 | + <exec_method type='method' name='stop' exec=':kill' timeout_seconds='60'> |
| 24 | + </exec_method> |
| 25 | + |
| 26 | + <instance name='mediawiki' enabled='false'> |
| 27 | + |
| 28 | + <method_context> |
| 29 | + <method_credential user='mediawiki' /> |
| 30 | + </method_context> |
| 31 | + |
| 32 | + <property_group name='startd' type='framework'> |
| 33 | + <propval name='duration' type='astring' value='transient' /> |
| 34 | + </property_group> |
| 35 | + |
| 36 | + </instance> |
| 37 | + |
| 38 | + <template> |
| 39 | + <common_name><loctext xml:lang='C'>PHP FastCGI</loctext></common_name> |
| 40 | + </template> |
| 41 | + </service> |
| 42 | +</service_bundle> |
Index: trunk/tools/smf/memcached.xml |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='memcached'> |
| 7 | + <service name='application/memcached' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' |
| 19 | + exec='/opt/wmf/smf/method-memcached %m' |
| 20 | + timeout_seconds='60'> |
| 21 | + <method_context> |
| 22 | + <method_credential user='memcached' /> |
| 23 | + </method_context> |
| 24 | + </exec_method> |
| 25 | + |
| 26 | + <exec_method type='method' name='stop' exec=':kill' timeout_seconds='60'> |
| 27 | + <method_context> |
| 28 | + <method_credential user='memcached' /> |
| 29 | + </method_context> |
| 30 | + </exec_method> |
| 31 | + |
| 32 | + <property_group name='startd' type='framework'> |
| 33 | + <propval name='duration' type='astring' value='transient' /> |
| 34 | + </property_group> |
| 35 | + |
| 36 | + <template> |
| 37 | + <common_name><loctext xml:lang='C'>memcached</loctext></common_name> |
| 38 | + </template> |
| 39 | + </service> |
| 40 | +</service_bundle> |
Index: trunk/tools/smf/method-msgbot |
— | — | @@ -0,0 +1,40 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +. /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +channel=`getproparg msgbot/irc-channel` |
| 12 | +logfile=`getproparg msgbot/logfile` |
| 13 | +nick=`getproparg msgbot/irc-nickname` |
| 14 | +server=`getproparg msgbot/irc-server` |
| 15 | +udpport=`getproparg msgbot/udp-port` |
| 16 | +udpaddr=`getproparg msgbot/udp-address` |
| 17 | + |
| 18 | +[[ -z "$channel" ]] && { echo >&2 "msgbot/irc-channel not set"; exit 1; } |
| 19 | +[[ -z "$nick" ]] && { echo >&2 "msgbot/irc-nickname not set"; exit 1; } |
| 20 | +[[ -z "$server" ]] && { echo >&2 "msgbot/irc-server not set"; exit 1; } |
| 21 | + |
| 22 | +if [[ -z "$logfile" ]]; then |
| 23 | + if [[ -z "$udpport" && -z "$udpaddr" ]]; then |
| 24 | + echo >&2 "if msgbot/logfile is not set, msgbot/udp-port and msgbot/udp-address must be set" |
| 25 | + exit 1 |
| 26 | + fi |
| 27 | +fi |
| 28 | + |
| 29 | +case "$1" in |
| 30 | + start) |
| 31 | + if [[ -z "$logfile" ]]; then |
| 32 | + ( /usr/local/bin/udprec $udpport $udpaddr | /usr/local/bin/ircecho $channel $nick $server ) & |
| 33 | + else |
| 34 | + ( tail +0f $logfile | /usr/local/bin/ircecho $channel $nick $server ) & |
| 35 | + fi |
| 36 | + ;; |
| 37 | + *) |
| 38 | + echo >&2 "usage: $0 start" |
| 39 | + exit 1 |
| 40 | + ;; |
| 41 | +esac |
Index: trunk/tools/smf/method-fisheye |
— | — | @@ -0,0 +1,31 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +. /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +installdir=`getproparg fisheye/install-dir` |
| 12 | + |
| 13 | +[[ -z "$installdir" ]] && { |
| 14 | + echo >&2 "fisheye/install-dir property is not set" |
| 15 | + exit 1 |
| 16 | +} |
| 17 | + |
| 18 | +JAVA_HOME=/usr/java |
| 19 | +export JAVA_HOME |
| 20 | + |
| 21 | +case "$1" in |
| 22 | + start) |
| 23 | + cd $installdir && bin/start.sh |
| 24 | + ;; |
| 25 | + stop) |
| 26 | + cd $installdir && bin/stop.sh |
| 27 | + ;; |
| 28 | + *) |
| 29 | + echo >&2 "usage: $0 <start|stop>" |
| 30 | + exit 1 |
| 31 | + ;; |
| 32 | +esac |
Index: trunk/tools/smf/hq-server.xml |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<?xml version="1.0"?> |
| 3 | +<!DOCTYPE service_bundle |
| 4 | + SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| 5 | + |
| 6 | +<service_bundle type='manifest' name='hq-server'> |
| 7 | + <service name='application/hq-server' type='service' version='1'> |
| 8 | + <create_default_instance enabled='false' /> |
| 9 | + |
| 10 | + <dependency |
| 11 | + name='multi-user-server' |
| 12 | + grouping='optional_all' |
| 13 | + type='service' |
| 14 | + restart_on='none'> |
| 15 | + <service_fmri value='svc:/milestone/multi-user-server' /> |
| 16 | + </dependency> |
| 17 | + |
| 18 | + <exec_method type='method' name='start' |
| 19 | + exec='/opt/wmf/smf/method-hq-server %m' |
| 20 | + timeout_seconds='60'> |
| 21 | + <method_context> |
| 22 | + <method_credential user='hq' /> |
| 23 | + </method_context> |
| 24 | + </exec_method> |
| 25 | + |
| 26 | + <exec_method type='method' name='stop' exec='/opt/wmf/smf/method-hq-server %m' timeout_seconds='60'> |
| 27 | + <method_context> |
| 28 | + <method_credential user='hq' /> |
| 29 | + </method_context> |
| 30 | + </exec_method> |
| 31 | + |
| 32 | + <property_group name='startd' type='framework'> |
| 33 | + <propval name='duration' type='astring' value='transient' /> |
| 34 | + </property_group> |
| 35 | + |
| 36 | + <template> |
| 37 | + <common_name><loctext xml:lang='C'>HQ server</loctext></common_name> |
| 38 | + </template> |
| 39 | + </service> |
| 40 | +</service_bundle> |
Index: trunk/tools/smf/Makefile |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +all: |
| 3 | + |
| 4 | +METHODS=\ |
| 5 | + method-jira \ |
| 6 | + method-confluence \ |
| 7 | + method-fisheye \ |
| 8 | + method-hq-server \ |
| 9 | + method-memcached \ |
| 10 | + method-msgbot \ |
| 11 | + method-php-fastcgi \ |
| 12 | + method-supybot \ |
| 13 | + method-sshtunnel \ |
| 14 | + |
| 15 | +install: |
| 16 | + /usr/ucb/install -d -m 0755 -o root -g root /opt/wmf |
| 17 | + /usr/ucb/install -d -m 0755 -o root -g root /opt/wmf/smf |
| 18 | + /usr/ucb/install -m 0755 -o root -g bin $(METHODS) /opt/wmf/smf |
| 19 | + /usr/sbin/svccfg import jira.xml |
| 20 | + /usr/sbin/svccfg import confluence.xml |
| 21 | + /usr/sbin/svccfg import fisheye.xml |
| 22 | + /usr/sbin/svccfg import hq-server.xml |
| 23 | + /usr/sbin/svccfg import memcached.xml |
| 24 | + /usr/sbin/svccfg import msgbot.xml |
| 25 | + /usr/sbin/svccfg import php-fastcgi.xml |
| 26 | + /usr/sbin/svccfg import supybot.xml |
| 27 | + /usr/sbin/svccfg import sshtunnel.xml |