The m2sh LIVES!
- From:
- Zed A. Shaw
- Date:
- 2010-07-18 @ 00:30
I finally got the m2sh to be rather damn useful, so tonight I'm going to
rewrite the wiki for getting start to include it, but I'd like some
testers if you don't mind.
First, make sure you fossil up.
Alright now do:
make clean all install
Better have Python and sudo access. If the m2sh install (which is
python) explodes on you then you can do that part manually by doing
this:
cd examples/python
sudo python setup.py install
And then figure out what needs to happen on your system for that to
work.
USING m2sh
==========
You now have m2sh so try doing the help:
m2sh help
m2sh help -for start
Now, try starting/stopping the sample server:
m2sh start -db tests/config.sqlite -host localhost -sudo
m2sh running -db tests/config.sqlite -host localhost
m2sh stop -db tests/config.sqlite -host localhost
You'll also notice that Mongrel2 now actually reads your config and does
the /logs/error.log and chroot from your server record.
Alright, now to play with the shell:
m2sh
m2> hosts -db tests/config.sqlite -host localhost
m2> dump -db tests/config.sqlite
m2> uuid
Notice the output's kind of lame, that'll improve later.
Now you can try loading a sample config (still in m2sh):
m2> init -db test.sqlite
m2> load -db test.sqlite -config examples/python/tests/sample_conf.py
m2> dump -db test.sqlite
There's also a replica of the mongrel2.org config:
m2> load -db test.sqlite -config examples/python/tests/mongrel2_org.py
m2> dump -db test.sqlite
DEPLOY LOGS
===========
Now for the fanciness, deploy logs:
m2> log -db test.sqlite
[2010-07-18T00:24:55, zedshaw@zedshaw, init_command] /usr/bin/m2sh
[2010-07-18T00:25:07, zedshaw@zedshaw, load_command] /usr/bin/m2sh
[2010-07-18T00:25:51, zedshaw@zedshaw, load_command] /usr/bin/m2sh
m2> commit -db test.sqlite -what mongrel2.org -why testing
m2> init -db test.sqlite
m2> log -db test.sqlite
[2010-07-18T00:24:55, zedshaw@zedshaw, init_command] /usr/bin/m2sh
[2010-07-18T00:25:07, zedshaw@zedshaw, load_command] /usr/bin/m2sh
[2010-07-18T00:25:51, zedshaw@zedshaw, load_command] /usr/bin/m2sh
[2010-07-18T00:28:39, zedshaw@zedshaw, mongrel2.org] testing
[2010-07-18T00:28:46, zedshaw@zedshaw, init_command] /usr/bin/m2sh
Notice how it works across inits? Unless you explicitly nuke the file
it will keep track of who did what to the config database. Super handy
for tracking bad admins. :-)
There's a bug in the commit command so if you want a more detailed
message don't use the shell:
m2sh commit -db test.sqlite -what localhost -why "I really wanted to."
Alright, play with all of that and report bugs so I can push this out.
--
Zed A. Shaw
http://zedshaw.com/