~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled_safe.in

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
pid_file=
23
23
err_log=
24
24
 
 
25
prefix=@prefix@
 
26
exec_prefix=@exec_prefix@
 
27
sbindir=@sbindir@
 
28
libdir=@libdir@
 
29
includedir=@includedir@
 
30
 
 
31
 
25
32
syslog_tag_drizzled=drizzled
26
33
syslog_tag_drizzled_safe=drizzled_safe
27
34
 
42
49
  --no-defaults              Don't read the system defaults file
43
50
  --defaults-file=FILE       Use the specified defaults file
44
51
  --defaults-extra-file=FILE Also use defaults from the specified file
45
 
  --ledir=DIRECTORY          Look for drizzled in the specified directory
46
52
  --open-files-limit=LIMIT   Limit the number of open files
47
53
  --core-file-size=LIMIT     Limit core files to the specified size
48
54
  --timezone=TZ              Set the system timezone
167
173
 
168
174
      # drizzled_safe-specific options - must be set in my.cnf ([drizzled_safe])!
169
175
      --core-file-size=*) core_file_size="$val" ;;
170
 
      --ledir=*) ledir="$val" ;;
171
176
      --drizzled=*) DRIZZLED="$val" ;;
172
177
      --drizzled-version=*)
173
178
        if test -n "$val"
199
204
 
200
205
 
201
206
#
202
 
# First, try to find BASEDIR and ledir (where drizzled is)
 
207
# First, try to find BASEDIR (where drizzled is)
203
208
#
204
209
 
205
210
if echo '@pkgdatadir@' | grep '^@prefix@' > /dev/null
211
216
fi
212
217
 
213
218
MY_PWD=`pwd`
214
 
# Check for the directories we would expect from a binary release install
215
 
if test -f "$relpkgdata"/english/errmsg.sys -a -x ./bin/drizzled
216
 
then
217
 
  MY_BASEDIR_VERSION=$MY_PWD            # Where bin, share and data are
218
 
  ledir=$MY_BASEDIR_VERSION/bin         # Where drizzled is
219
219
# Check for the directories we would expect from a source install
220
 
elif test -f "$relpkgdata"/english/errmsg.sys -a -x ./libexec/drizzled
 
220
if test -f "$prefix"/include/drizzled/error.h -a -x "${sbindir}"/drizzled
221
221
then
222
222
  MY_BASEDIR_VERSION=$MY_PWD            # Where libexec, share and var are
223
 
  ledir=$MY_BASEDIR_VERSION/libexec     # Where drizzled is
224
223
# Since we didn't find anything, used the compiled-in defaults
225
224
else
226
225
  MY_BASEDIR_VERSION=@prefix@
227
 
  ledir=@libexecdir@
228
226
fi
229
227
 
230
228
 
232
230
# Second, try to find the data directory
233
231
#
234
232
 
235
 
# Try where the binary installs put it
236
 
if test -d $MY_BASEDIR_VERSION/data/mysql
237
 
then
238
 
  DATADIR=$MY_BASEDIR_VERSION/data
239
 
  if test -z "$defaults" -a -r "$DATADIR/my.cnf"
240
 
  then
241
 
    defaults="--defaults-extra-file=$DATADIR/my.cnf"
242
 
  fi
243
 
# Next try where the source installs put it
244
 
elif test -d $MY_BASEDIR_VERSION/var/mysql
 
233
if test -d $MY_BASEDIR_VERSION/var
245
234
then
246
235
  DATADIR=$MY_BASEDIR_VERSION/var
247
236
# Or just give up and use our compiled-in default
249
238
  DATADIR=@localstatedir@
250
239
fi
251
240
 
252
 
if test -z "$MYSQL_HOME"
 
241
if test -z "$DRIZZLE_HOME"
253
242
then 
254
243
  if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf"
255
244
  then
258
247
$DATADIR/my.cnf
259
248
IGNORING $DATADIR/my.cnf"
260
249
 
261
 
    MYSQL_HOME=$MY_BASEDIR_VERSION
 
250
    DRIZZLE_HOME=$MY_BASEDIR_VERSION
262
251
  elif test -r "$DATADIR/my.cnf"
263
252
  then
264
253
    log_error "WARNING: Found $DATADIR/my.cnf
265
254
The data directory is a deprecated location for my.cnf, please move it to
266
255
$MY_BASEDIR_VERSION/my.cnf"
267
 
    MYSQL_HOME=$DATADIR
 
256
    DRIZZLE_HOME=$DATADIR
268
257
  else
269
 
    MYSQL_HOME=$MY_BASEDIR_VERSION
 
258
    DRIZZLE_HOME=$MY_BASEDIR_VERSION
270
259
  fi
271
260
fi
272
 
export MYSQL_HOME
 
261
export DRIZZLE_HOME
273
262
 
274
263
 
275
264
# Get first arguments from the my.cnf file, groups [drizzled] and [drizzled_safe]
383
372
  fi
384
373
fi
385
374
 
386
 
safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
 
375
safe_mysql_unix_port=${mysql_unix_port:-${DRIZZLE_UNIX_PORT:-@DRIZZLE_UNIX_ADDR@}}
387
376
# Make sure that directory for $safe_mysql_unix_port exists
388
377
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
389
378
if [ ! -d $mysql_unix_port_dir ]
399
388
  DRIZZLED=drizzled
400
389
fi
401
390
 
402
 
if test ! -x $ledir/$DRIZZLED
 
391
if test ! -x $sbindir/$DRIZZLED
403
392
then
404
 
  log_error "The file $ledir/$DRIZZLED
 
393
  log_error "The file $sbindir/$DRIZZLED
405
394
does not exist or is not executable. Please cd to the mysql installation
406
395
directory and restart this script from there as follows:
407
396
./bin/drizzled_safe&
533
522
 
534
523
cmd="$NOHUP_NICENESS"
535
524
 
536
 
for i in  "$ledir/$DRIZZLED" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
 
525
for i in  "$sbindir/$DRIZZLED" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
537
526
  "--datadir=$DATADIR" "$USER_OPTION"
538
527
do
539
528
  cmd="$cmd "`shell_quote_string "$i"`
561
550
    # but should work for the rest of the servers.
562
551
    # The only thing is ps x => redhat 5 gives warnings when using ps -x.
563
552
    # kill -9 is used or the process won't react on the kill.
564
 
    numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$DRIZZLED\>" | grep -c "pid-file=$pid_file"`
 
553
    numofproces=`ps xaww | grep -v "grep" | grep "$sbindir/$DRIZZLED\>" | grep -c "pid-file=$pid_file"`
565
554
 
566
555
    log_notice "Number of processes running now: $numofproces"
567
556
    I=1
568
557
    while test "$I" -le "$numofproces"
569
558
    do 
570
 
      PROC=`ps xaww | grep "$ledir/$DRIZZLED\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` 
 
559
      PROC=`ps xaww | grep "$sbindir/$DRIZZLED\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` 
571
560
 
572
561
      for T in $PROC
573
562
      do