Monday, December 29, 2008

simple svnserve script

I wanted to shutdown or stop svnserve properly: Easy if you start it correctly... The following lines are a very basic scripts to have in /etc/init.d/svnserve
#!/bin/sh
case "$1" in
    start)
      svnserve -d -r /srv/svn/repos --pid-file /srv/svn/svnserve.pid
      ;;
    stop)
      kill -9 `cat /srv/svn/svnserve.pid`
      ;;
    restart)
      $0 start
      $0 stop
      ;;
    *)
      echo "Usage: /etc/init.d/svnserve {start|stop|restart}"
      exit 1
      ;;
esac
exit 0
As i said, this is vey basic, checking for the "/srv/svn/svnserve.pid" file could be added and deleting it would be also fine. Anyhow, this seems enought for now.

Wednesday, December 17, 2008

roundup issue tracker

Roundup is a said to be a simple issue tracker. Some documentation exist about integrating subversion and roundup that being my target. However i had some self imposed limitations:
  • Use debian packages
  • No smtp server, and i dont want to have any running
After some hours of work, i came out with this step by step solution.

Install roundup:

prompt# apt-get install roundup

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
...
Selecting previously deselected package roundup.
(Reading database ... 19361 files and directories currently installed.)
Unpacking roundup (from .../roundup_1.4.4-2_all.deb) ...
Processing triggers for man-db ...
Setting up roundup (1.4.4-2) ...
Starting Roundup HTTP-Server: roundup-server.

OK, so that!. Now i have a roundup-server running. But no Tracker. You see, the Tracker is where the info will be stored, the issue repository, the database. So i need to create a tracker. My setup only requires one tracker, and i want to have it under /var/rounup/trackername. This is what i did.

root@server:/var/roundup# roundup-admin install
Enter tracker home: /var/roundup/trackername
Templates: minimal, classic
Select template [classic]: classic
Back ends: anydbm, sqlite
Select backend [anydbm]: sqlite

---------------------------------------------------------------------------
 You should now edit the tracker configuration file:
   /var/roundup/trackername/config.ini
 ... at a minimum, you must set following options:
   [mail]: domain, host
   [tracker]: web

 If you wish to modify the database schema,
 you should also edit the schema file:
   /var/roundup/trackername/schema.py
 You may also change the database initialisation file:
   /var/roundup/trackername/initial_data.py
 ... see the documentation on customizing for more information.

 You MUST run the "roundup-admin initialise" command once you've performed
 the above steps.
---------------------------------------------------------------------------
There it is. My first Tracker. Still some edit has to be done. The most important value to set, since i do not have/want SMTP around is in the [mail]::debug...
[mail]
# Setting this option makes Roundup to write all outgoing email
# messages to this file *instead* of sending them.
# This option has the same effect as environment variable SENDMAILDEBUG.
# Environment variable takes precedence.
# The path may be either absolute or relative
# to the directory containig this config file.
# Default:
debug = reponame.mail.log
With this configuration, all the mails sent to the admin (with setup errors / warnings, etc) will end it that file.
root@server:/var/roundup# roundup-admin initialise
Enter tracker home: /var/roundup/trackername
Admin Password:*****
       Confirm:*****
Next step is to make the Tracker available throught the roundup server. We have to add these lines on /etc/roundup/roundup-server.ini
[trackers]
trackername = /var/roundup/trackername
and restart the roundup server
/etc/init.d/roundup restart
watch /var/log/roundup/roundup.log and /var/log/roundup/reponame.mails.log for errors. finally one of the problems i left was permision related...
    chmod roundup.roundup -R /var/roundup/trackname