I've started fiddling with usher on Debian and trying to figure out a good way to have it replace a bare monotone server (the way it's currently done with the Debian package monotone-server), and the big question was how to have a smooth and transparent transition.

Of course, it's a matter of configuration, and the result I came with was to have a catch all usher server stanza in the usher configuration file:

   server ".catchall."
  pattern ""
    local "--confdir=/etc/monotone"
          "--db=/var/lib/monotone/default.mtn"
          "--no-standard-rcfiles" "--rcfile=/etc/monotone/hooks.lua"
          "--keydir=/var/lib/monotone/keys"

(The parameters following local are the same given to the server process in monotone-server)

The crucial part here is to have that empty pattern prefix, it will really catch anything that's sent to usher with the following form:

  mtn pull 'mtn://{host}:{port}?{branch1};{branch2}'

Calls that include a server name, such as the following, will match the stanza with the correspoding server name or will return an error of there is none:

  mtn pull 'mtn://{host}:{port}/{server}?{branch1};{branch2}'

Note: if your really doing this to replace Debian's monotone-server process, make sure the usher process is run by the user monotone user. It should really not be too difficult to copy /etc/init.d/monotone and change it to work with usher. I might post an usher-specific init script in another blog entry...

blog comments powered by Disqus