Piotras' blog: Archive

2008-07-01 - 2008-07-31

New binary packages for Midgard 1.8

Posted on 2008-07-09 08:22:49 UTC.

At last, Debian is not the only one platform, for which we provide Midgard binary packages. We started to build packages using quite nice and powerful opensuse build system. A bit difficult to build debian packages out of the box, but with few tricks used here and there, we have binary packages for debian stable and ubuntu. For both, 32bit and 64bit architectures. Debs are not the only ones we buil there. Included distributions are: CentOS ( RedHat ), Fedore Core and Opensuse. You can browse all of them.

Debian and Ubuntu users can try to install packages with apt-get, adding such line to /etc/apt/sources.list:

deb http://download.opensuse.org/repositories/home:/midgardproject:/midgard18/Debian_Etch ./

Kudos and big thanks to everaldo and potyl!. It couldn't be done, without you guys.

Debug memory of PHP module

Posted on 2008-07-09 18:55:41 UTC.

The first question I ask to myself. What's the difference between PHP module and extension? Is it like, that PHP has modules while Zend extensions? If yes, why? If not, why there are both types? There are no comments allowed, so questions remain unanswered. Well... as usual, I would say. That's nature of Zend/PHP support.

Anyway, you wrote PHP module and want to debug or profile its memory. Or you just want to catch all memory leaks. The first action is to run php via valgrind, but in such case, the log file is far from being helpfull:

==17786== 4,096 bytes in 1 blocks are definitely lost in loss record 843 of 860
==17786==    at 0x4C20FEB: malloc (vg_replace_malloc.c:207)
==17786==    by 0x4C21134: realloc (vg_replace_malloc.c:429)
==17786==    by 0xCFAD9C8: ???
==17786==    by 0xCF93A59: ???
==17786==    by 0xCD533D6: ???
==17786==    by 0xCAFB918: ???
==17786==    by 0xDEE3D40: ???
==17786==    by 0xBA69642: ???
==17786==    by 0xBA6E924: ???
==17786==    by 0xBA67E89: ???

This is not what you expected. And to be honest, this is something which tells you nothing but nothing :)

PHP just unloads your module, so there's nothing which can be mentioned in log file. Luckilly, I found that module ( zend_module_entry ) has handle member which, if set to 0 tells zend, that your module should not be unloaded.

In practice, you should add similiar code to RSHUTDOWN:

zend_module_entry *module;
int rv = zend_hash_find(&module_registry, "module_name", strlen("module_name")+1, (void**)&module);

if(rv == SUCCESS)
    module->handle = 0;

Once it's added, recompile module and run php via valgrind. Keep in mind, this code should be used for debug purposes only.

Create more, work less

Posted on 2008-07-18 11:06:29 UTC.

Providing easy to install binary packages for users and developers is not funny task, but also it's very important step in software development process.

Recently, I blogged about new binary packages for Midgard. And instead of waiting for feedback I decided to go few steps further. And just today we started to serve Midgard from three different repositories. One is for stable release, second for upcoming 1.9 which contains automatically built packages for developers, and third one is reserved for stable 1.9 release.

Packages are built at opensuse build system ( OBS ), and now we support debian, ubuntu and opensuse distros. Both 32bit and 64bit environments. Soon, we'll add support for CentOS and Fedora Core.

To test packages add to sources.list:

Debian:

http://download.opensuse.org/repositories/home:/midgardproject:/midgard19-dev/Debian_Etch ./

Ubuntu:

http://download.opensuse.org/repositories/home:/midgardproject:/midgard19-dev/xUbuntu_8.04 ./

You can also use OBS search functionality to find package and install it with one click. Just type 'midgard' and select distribution you use.

It's worth mentioning that new build process is fully automated. The script which is invoked periodically on machine acts like automated release manager and looks like this:

Get latest sources:

svn co https://svn.midgard-project.org/midgard/branches/branch-1-9/midgard obsmidgard

Go to sources directory

cd obsmidgard

Create tarballs and set default version to all packages.

./makedist

Login into OBS, remove old tarballs and upload new ones. Trigger rebuild.

php obs_upload.php

Clean all when it's done.

cd -
rm -rf obsmidgard

It's enough to commit changes to svn if anything must be changed. Script will use new functionalities when running next time.

Once we can find this usefull, we're going to create new repositories. For Midgard2.

More options for datagard

Posted on 2008-07-29 11:14:45 UTC.

New, rewritten datagard, which is responsible to correctly install Midgard has now more usable options. Basically it upports different setup types and different setup actions. Or combinations.

First you can start quick setup mode:

datagard -t q

It installs Midgard and doesn't ask you any questions, taking good default values for everything.

You can also set some key in configuration file:

datagard -t config -c midgard -a config-set loglevel message

Use 'config' setup type, take named 'midgard' as configuration and set 'message' as 'loglevel' key.

Create new sitegroup or new virtual host ( with default wizard setup type ) :

datagard -a sitegroup
datagard -a vhost

In latter case you are also asked for sitegroup, so if you want to create both, select this option. An interesting fact is that datagard, when creating new host will ask you if you want to create host for MidCOM3. When you say 'yes', your MidCOM3 has no page elements and empty content for page.

Iron Man

Posted on 2008-07-30 16:46:41 UTC.

Maybe quiz itself is old, but who cares ;)

Your results:
You are Iron Man

Iron Man
75%
The Flash
70%
Superman
65%
Green Lantern
65%
Spider-Man
60%
Supergirl
55%
Robin
52%
Batman
40%
Wonder Woman
40%
Hulk
40%
Catwoman
25%
Inventor. Businessman. Genius.
Click here to take the Superhero Personality Test

Back

Layout Copyright © 2006 Finnish Teleservice Center Ltd Oy - Site Powered by Midgard CMS