michael@5: #!@l_prefix@/bin/openpkg rc michael@5: ## michael@5: ## rc.mico -- Run-Commands michael@5: ## michael@5: michael@5: %config michael@5: mico_enable="$openpkg_rc_def" michael@5: mico_micod="no" michael@5: mico_nsd="no" michael@5: mico_ip_micod="127.0.0.1" michael@5: mico_ip_nsd="127.0.0.1" michael@5: mico_micod_args="-ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 -ORBIIOPAddr inet:${mico_ip_micod}:8912" michael@5: mico_nsd_args="-ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 -ORBIIOPAddr inet:${mico_ip_nsd}:8914" michael@5: michael@5: %common michael@5: mico_micod_pidfile="@l_prefix@/var/mico/micod.pid" michael@5: mico_nsd_pidfile="@l_prefix@/var/mico/nsd.pid" michael@5: mico_signal () { michael@5: local rc_micod=0 michael@5: local rc_nsd=0 michael@5: if rcVarIsYes mico_micod; then michael@5: [ -f $mico_micod_pidfile ] \ michael@5: && kill -$1 `cat $mico_micod_pidfile` michael@5: rc_micod=$? michael@5: fi michael@5: if rcVarIsYes mico_nsd; then michael@5: [ -f $mico_nsd_pidfile ] \ michael@5: && kill -$1 `cat $mico_nsd_pidfile` michael@5: rc_nsd=$? michael@5: fi michael@5: [ $rc_micod -eq 0 -a $rc_nsd -eq 0 ] michael@5: } michael@5: michael@5: %status -u @l_rusr@ -o michael@5: mico_usable="unknown" michael@5: mico_active="no" michael@5: rcService mico enable yes && \ michael@5: ( rcVarIsYes mico_micod || rcVarIsYes mico_nsd ) && \ michael@5: mico_signal 0 && mico_active="yes" michael@5: echo "mico_enable=\"$mico_enable\"" michael@5: echo "mico_usable=\"$mico_usable\"" michael@5: echo "mico_active=\"$mico_active\"" michael@5: michael@5: %start -u @l_rusr@ michael@5: rcService mico enable yes || exit 0 michael@5: rcService mico active yes && exit 0 michael@5: # run the object adapter daemon for dynamic object activation michael@5: if rcVarIsYes mico_micod; then michael@5: @l_prefix@/bin/micod ${mico_micod_args} & michael@5: echo $! >$mico_micod_pidfile michael@5: fi michael@5: # run the name service daemon for flexible object indexing michael@5: if rcVarIsYes mico_nsd; then michael@5: @l_prefix@/bin/nsd ${mico_nsd_args} & michael@5: echo $! >$mico_nsd_pidfile michael@5: fi michael@5: michael@5: %stop -u @l_rusr@ michael@5: rcService mico enable yes || exit 0 michael@5: rcService mico active no && exit 0 michael@5: mico_signal TERM michael@5: rm -f $mico_micod_pidfile 2>/dev/null || true michael@5: rm -f $mico_nsd_pidfile 2>/dev/null || true michael@5: michael@5: %restart -u @l_rusr@ michael@5: rcService mico enable yes || exit 0 michael@5: rcService mico active no && exit 0 michael@5: rc mico stop michael@5: sleep 2 michael@5: rc mico start michael@5: