datadir should be more sensible

Bug #366371 reported by Selena Deckelmann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Wishlist
Monty Taylor
7.0
Fix Released
Wishlist
Monty Taylor
Cherry
Won't Fix
Wishlist
Monty Taylor

Bug Description

I'd love to be able to do this and have drizzle start properly as a non-root user:

./drizzled --datadir=data

/usr/local/var is not a nice default location for database files. Let's be nicer to sysadmins :)

In the event that a configuration file does not exist, it would be nice if drizzle did the following:

* By default search for the data directory in the current working directory and refuse to start if that directory does not exist and it cannot create the default directory
SUGGESTION: define the default name of the data directory ("data" or "drizzle" seems sane :)

description: updated
description: updated
Revision history for this message
Jeremy Zawodny (jeremy-zawodny) wrote :

Assuming the directory exists, this works as a non-root user for me when built from trunk (see below). So the main issue here is that you'd like to see drizzled create the data dir if it does not exist, right?

---snip---

jzawodn@wks-jeremy:~/src/drizzle/trunk$ mkdir /tmp/drizzle2 ; ./drizzled/drizzled --datadir /tmp/drizzle2
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
090424 14:10:59 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
090424 14:10:59 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
090424 14:10:59 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
090424 14:11:00 InnoDB Plugin 1.0.3 started; log sequence number 0
./drizzled/drizzled: ready for connections.
Version: '2009.04.997-trunk' socket: '' port: 4427 Source distribution

Revision history for this message
Selena Deckelmann (selenamarie) wrote :

Yeah, my report was not clear. Sorry! I agree that it would be nice for drizzle to create a subdirectory automatically.

The other issue is that 'localstatedir' in the autoconf is defined as '/usr/local/var'. That shouldn't be used for the default datadir. At the least it should be a subdirectory, and better would be to define it as something sane like $PREFIX/data or $PREFIX/drizzle.

Revision history for this message
Jay Pipes (jaypipes) wrote :

The problem is with *relative* datadirs... absolute ones work fine. relative ones behave incorrectly, IMHO...

Jay Pipes (jaypipes)
summary: - Sane installation defaults without a config file
+ datadir should be more sensible
Changed in drizzle:
importance: Undecided → Wishlist
milestone: none → low-hanging-fruit
status: New → Confirmed
Revision history for this message
Joe Daly (skinny.moey) wrote :

Im adding this to this bug, although maybe it should be its own. I was running into this error with --datadir

jdaly@rx7:~/drizzle/repos/drizzle-misc-bug-fixes/drizzled> drizzled --no-defaults --port=4500 --basedir=$PWD --datadir=$PWD/var
Aborting
drizzled: Shutdown complete
jdaly@rx7:~/drizzle/repos/drizzle-misc-bug-fixes/drizzled>

The problem turned out to be the directory I have for datadir didn't exist. We seem to be eating a lot of output rather then sending it to std out for any of the drizzled options that cant be processed. Most options with a bad value will result with the output above.

Revision history for this message
Monty Taylor (mordred) wrote :

Two of the three issues here have been addressed (error message now prints to stderr on missing datadir, /usr/local/var is no longer the default data dir (it's $PREFIX/var/drizzle now). I'm going to leave it open because doing --datadir=foo and having that, for some reason translate into datadir=$PREFIX/foo is really weird.

Changed in drizzle:
assignee: nobody → Monty Taylor (mordred)
milestone: low-hanging-fruit → bell
Changed in drizzle:
milestone: bell → low-hanging-fruit
Monty Taylor (mordred)
Changed in drizzle:
milestone: low-hanging-fruit → 2010-04-26
Revision history for this message
Monty Taylor (mordred) wrote :

This is actually all fixed now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.