Page MenuHomePhabricator

Install maintenance script needs to provide appropriate exit status in ALL cases
Open, MediumPublic


Author: ezyang

Something of a follow up to Bug 17948. We appear to offer an exit code 1 when --help is called, but in no other circumstances (for example, if we fail to connect to the database.)

There might be other maintenance scripts that have grown since 17948 was resolved, which don't have proper exit codes either, but install.php should be a priority, since it's more likely to be scripted with.

Version: 1.20.x
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:34 PM
bzimport set Reference to bz29588.
bzimport added a subscriber: Unknown Object (MLST).

ezyang wrote:

This only appears to be a problem for certain types of errors, not all of them. Here is the one particular example I ran into, but there may be more. Is there a reason why support here is so patchy?

ezyang@javelin:~/Dev/phase3$ php maintenance/install.php --dbserver localhost.asdf foo bar
PHP 5.3.3-1ubuntu9.5 is installed.
Warning: Could not find eAccelerator, APC, XCache or WinCache.
Object caching is not enabled.
Found ImageMagick: /usr/bin/convert.
Image thumbnailing will be enabled if you enable uploads.
Using server name "http://localhost".
Warning: The intl PECL extension is not available to handle Unicode normalization, falling back to slow pure-PHP implementation.
If you run a high-traffic site, you should read a little on Unicode normalization.
The environment has been checked.
You can install MediaWiki.
Setting up database
DB connection error: Unknown MySQL server host 'localhost.asdf' (1) (localhost.asdf).
Check the host, username and password and try again.

ezyang@javelin:~/Dev/phase3$ echo $?

(In reply to comment #1)

Is there
a reason why support here is so patchy?

The CLI installer has not been a major focus for work. I needed it for a specific case (to run on the test server), but after that I wasn't too concerned with it.

That said, I would like to see improvement on it. Do you want to take it over?

I kind of wish we had dropped the CLI installer from REL1_17...