dead database.lock with scripts/dbInstall.php > install.log #219

Closed
hdorio opened this Issue Jul 15, 2012 · 1 comment

Projects

None yet

2 participants

@hdorio
hdorio commented Jul 15, 2012

php scripts/dbInstall.php > install.log

[TestSwarm 1.0.0-alpha] Maintenance script

DBInstall: Install the TestSwarm database. Can also clear a database if it exists.
           ------------------------------------------------------------------------
Setting database.lock, other requests may not access the database during installation.
Database already contains tables. If you continue, all tables will be dropped. (Y/N)

TestSwarm Error: This script requires an interactive terminal for output and input

You can see there is no "Removed database.lock" line

The script seems to skip a step "2.1 remove database.lock" here

  1. set a database.lock
  2. call cliInput()
  3. exit(' requires an interactive terminal blah blah')
@Krinkle
Member
Krinkle commented Oct 13, 2012

We'd have to implement some sort of exit-hook to clean up, however cliInput could be asked for halfway a maintenance script, so we don't want to remove the lock regardless of how and when we exited, only if it is done.

dbInstall.php only removes the lock for acceptable exit strategies. Any unexpected exit paths or exits by other classes (such as the case of "requires an interactive terminal") leave the lock in place, this is because in those cases it is likely a problem that you (the user) should address before continuing.

In this case, pass option --quiet which will skip any questions (automatically answering with ""). If you want to re-install and force-remove existing tables (as opposed to silently running the installer which will do nothing if it has already been installed), then pass --force as well.

@Krinkle Krinkle closed this Oct 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment