3 # start -- start up configured conmux servers on this host.
5 # (C) Copyright IBM Corp. 2004, 2005, 2006
6 # Author: Andy Whitcroft <andyw@uk.ibm.com>
8 # The Console Multiplexor is released under the GNU Public License V2
10 if [ -f ~
/.gmm.conf
]; then
13 CONMUX
=${CONMUX:-/usr/local/conmux}
16 if [ "$1" != "" ]; then
20 PATH
=$CONMUX/bin
:$CONMUX/sbin
:$CONMUX/lib
/drivers
:$CONMUX/lib
/helpers
:$PATH
24 typeset pf
="$CONMUX/log/$name.pid"
28 # Determine whether it is already running ... if so leave it be.
30 if kill -0 `cat "$pf"` 2>/dev
/null
; then
35 echo "starting $name ..."
36 "$@" >"$CONMUX/log/$name.log" 2>&1 &
43 typeset pf
="$CONMUX/log/$name.pid"
45 echo "stopping $name ..."
46 # Kill it and clear up
47 kill -HUP `cat "$pf"` 2>/dev
/null
52 for i
in $CONMUX/log
/*.pid
57 if [ "$n" != "*" ]; then
58 existing
="$existing $n"
62 if [ "$cmd" = "start" ]; then
64 [ -f $CONMUX/etc
/registry
] ||
touch $CONMUX/etc
/registry
65 start registry
$CONMUX/sbin
/conmux-registry
63000 $CONMUX/etc
/registry
66 if [ "$?" -eq 0 ]; then
71 for i
in $CONMUX/etc
/*.cf
76 if [ "$n" != "*" ]; then
77 if [ -f "$CONMUX/log/$n.cf" ]; then
78 if ! cmp -s "$i" "$CONMUX/log/$n.cf"; then
82 start
$n $CONMUX/sbin
/conmux
$i
83 if [ "$?" -eq 0 ]; then
88 # Preserve the orginal configuration file.
89 cp "$i" "$CONMUX/log/$n.cf"
91 if grep -q TYPE
:numaq
"$i"; then
92 autoboot
="$autoboot $n"
94 for i
in `grep FLAGS: "$i"`; do
97 *) autoboot
="$autoboot $n/$i" ;;
102 if [ "$pause" -eq 1 ]; then
111 start
$name-$helper-helper $CONMUX/bin
/conmux-attach
$mn $helper-helper
112 started
="$started $name-$helper-helper"
116 if [ "$cmd" = "start" -o "$cmd" = "stop" ]; then
126 if [ "$cmd" = "status" ]; then
134 status
=`console -s $mn`