After #461488: Packaging Drush for Debian, I'll be working on a provision package, to make sure we have the backend in order and can easily setup new servers.

the frontend will be much more tricky, so I will probably refrain from working on it for now... especially since we don't have much need for it (aegir is already installed) unless it performs upgrades magically (which would be hard anyways).

Comments

anarcat’s picture

Status: Active » Needs work

I've got a basic package up that properly installs the command files so that drush can see it, but it doesn't do any of the magic from INSTALL.txt that it should do.

I'm also waiting for my ITP number so I can upload this for review...

anarcat’s picture

Status: Needs work » Needs review

I uploaded a package that does everything but the setup of the initial root user. It's also available on Koumbit's repo:

deb http://debian.koumbit.net/debian sid main

Again, it's uploaded to sid, but it was built on lenny and should work almost anywhere.

Now I need my sponsor to get that in too.

anarcat’s picture

Status: Needs review » Needs work

So while talking with my sponsor about the most recent package, it became obvious that the package violates section 10.7.4 of the debian policy described here: http://www.debian.org/doc/debian-policy/ch-files.html

Basically, a Debian package is not allowed to modify another package's configuration files while installing. There are two particular violations in my package, the one that modifies /etc/sudoers and the one that edits /etc/drush/drushrc.php. The latter could easily be fixed by making drush read all files in /etc/drush/ instead of just the drushrc.php. The former is harder, as we're supposed to either make the admin modify the sudoers file or make sudo package a script that will allow other packages to modify the sudoers file.

I'm not sure it's that big of a deal and I will try to get other advice from the debian-devel list. In the meantime, the package is basically blocked from Debian while we figure this out.

anarcat’s picture

This will be fixed by the latest sudo upload, which supports .d directories... I just need to push it to NEW... Anyways, the most recent package code from git doesn't have the sudo hacking code anymore, so it should land in Debian as soon as my sponsor can look into it.

jaxpax’s picture

tracking

anarcat’s picture

Status: Needs work » Needs review

Aegir-provision (0.3!) has been uploaded and will enter the NEW queue process soon. Watch for it on http://ftp-master.debian.org/new.html

It still doesn't feature sudo support because while a newer sudo version was uploaded to debian with the capability of including directories, it doesn't actually create a config file that does, see:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539994

anarcat’s picture

Status: Needs review » Needs work

Provision is now in Debian unstable. I'm working on sudo autoconfiguration.

anarcat’s picture

Version: 6.x-0.2 » 6.x-0.3
Status: Needs work » Fixed

alright, this package is now fully in debian, and is up to my expectations. all further requests regarding debian packaging should be addressed through the Debian BTS (bug tracking system), see http://bugs.debian.org/aegir-provision.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

anarcat’s picture

Status: Closed (fixed) » Needs work

Aegir-provision was removed from Debian, as the package was outdated (0.3!) and slightly buggy:

http://packages.qa.debian.org/a/aegir-provision/news/20100907T104534Z.html

Known bugs:

http://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=both;dist=unstable;...

I am thinking of redoing the packaging for beta1.

anarcat’s picture

I recreated the debian branch here:

http://git.aegirproject.org/?p=provision.git;a=shortlog;h=refs/heads/debian

A few caveats:

* installs in /var/aegir again (regression: we don't follow the FHS anymore)
* doesn't actually configure apache anymore (regression: we would need to call hostmaster-install...)
* doesn't configure the www-data group (and so on) in the drushrc (which makes everything simpler, again delegated to hostmaster-install)

I haven't actually tested the new package at all. I wonder if we should prompt the user to see if he wants to install the aegir frontend.. or how do we deal with this?

anarcat’s picture

So yeah, after a quick talk with miguel, here's what I think we should do:

1. call hostmaster-install with proper args
2. configure apache and reload it
3. run hostmaster-migrate on upgrades

Easier said than done, but I believe it's the way forward. The especially hairy part here is how to prompt for stuff like the FQDN and so on. This can be done through nice debconf prompts or hostmaster-install, but then we would end up passing the root mysql password on the commandline, which would appear in ps(1), which is bad. The opposite is to let hostmaster-install do its thing, but then the user can't control what's happening.

I think all settings should be prompted by debconf, at least with priority low (but how do we sync defaults then?) and then feed those through hostmaster-install. We need to figure out a safe way to feed the mysql password, probably through a /dev/pts hack...

hostmaster-migrate ironically sounds easier: the backend is already upgraded, just need to call hostmaster-migrate and boom you're done.

anarcat’s picture

Oh and to do things properly, we need to #980152: package drush_make for Debian.

anarcat’s picture

I have a first package that installs aegir from A to Z. Haven't tested remote servers yet, but they should also work. To quote the critical stuff marked in debian/TODO:

* don't try to install over existing sites
* (ie. support upgrades)
* don't show the mysql root password on the commandline
* don't prompt for the mysql root if already installed

Ie. this works well for first installs, but is critically broken beyond that:

* it will fail when trying to reinstall (PROVISION_SITE_INSTALLED) (where it should just do nothing)
* it will probably install a new hostmaster if doing an upgrade
* yay security, should probably use the /dev/fd hack
* it will bug you repeatedly for the mysql root password on every upgrade where it doesn't actually need that crap

anarcat’s picture

Alright, handled most cases above, just need to fix the mysql password problem on install and test upgrades.

anarcat’s picture

So this freaking works now. I was able to successfully:

* install 0.4-beta1 (locally)
* upgrade from a manual 0.4-alpha15 install cleanly (i just had to trash /var/aegir/.drush/provision)

Pretty amazing. This just shows how strong our install and upgrade scripts have become. :)

So we still have a few todos here:

1. the mysql password still shows up on the commandline
2. this needs to be uploaded to unstable (although it will probably never hit squeeze)

There are a few other cosmetic and policy compliance things that may impede on #2 (tracked in debian/TODO), but worst case we hold the package on debian.koumbit.net.

For #1, I feel it may be time for hostmaster-install to respect existing contexts. That would be the most elegant way of passing information around: just store it straight in the context and let hostmaster-install use it directly. Not sure how to do this... but i would prefer it to the file descriptor hack.

Too bad I have to keep this marked as "needs work"... :P (I need to fix the security issue and upload *somewhere* before I close this)

People that want to build this package can switch the debian branch and run ./debian/rules release

anarcat’s picture

Duh, just found the fix for the mysql password: we can feed data as JSON through STDIN! That will solve the problem. But first sleep.

anarcat’s picture

Status: Needs work » Needs review
Issue tags: +debian

I have fixed the password leak issue.

I have uploaded the package to http://debian.koumbit.net/ see that page for instructions, or head to this page to download the .deb directly: http://debian.koumbit.net/debian/pool/main/a/aegir-provision/

testing would be appreciated, both for new installs and upgrades. Of course, backups are recommended before installing. :)

I'll try to see if this can be uploaded to unstable.

Anonymous’s picture

I have added the Koumbit repo to my sources list, even applied the key, but can't apt-cache search aegir-provision

Is it not in lenny/main ?

anarcat’s picture

Sorry, it's in unstable.

Anonymous’s picture

Still trying to test this - it appears it depends on a version of sudo that is not available in Lenny.. I'll try to get an old fashioned virtual machine up

Anonymous’s picture

I managed to dist-upgrade to squeeze and then I tried again, and got this error on install:

adding aegir user...                                                                                                                                                    
Adding user aegir to group www-data

Creating config file /etc/sudoers.d/aegir with new version
chown: cannot access `/var/aegir/backups': No such file or directory
dpkg: error processing aegir-provision (--configure):
 subprocess installed post-installation script returned error exit status 1

Although it's hard to say if this is an ugly system from the dist-upgrade. I'll still try to get a VirtualBox going shortly

Anonymous’s picture

Status: Needs review » Needs work

So I've not had a chance to test this again :(

but the error above is pretty self explanatory:

Lines 59 through 64 of postinst suggest chmodding /var/aegir/backups and /var/aegir/config, but prior to running the install (which is what creates these directories, on provision-verify of the server context from memory)

So is this an oversight possibly due to a focus on handling an upgrade (where these dirs would probably already exist) ?

I am not against mkdir'ing these first, or perhaps the loop can not be just against an array of directory paths but on the condition that they exist at all. On the other hand, provision-verify should be setting the correct permissions anyway, so I'm not sure the chmod is even required here?

Also, as a side note, a chmod of 700 on /var/aegir/config will actually break sites' settings.php ability to read the global.inc include because www-data can't cd into the dir to read it. We used to do that in provision too, but it got fixed. See this commit

anarcat’s picture

Thank you very much for the review!

I removed the ~/backups and ~/config handling.

I also removed the version-specific dependency of sudo in favor of a warning message if sudoers.d doesn't exist.

I'll upload a new package shortly.

anarcat’s picture

This needs to be updated to rc1...

steven jones’s picture

Can we close out this issue now?

anarcat’s picture

Status: Needs work » Fixed

I guess we can followup in the ITP anyways: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539994

Status: Fixed » Closed (fixed)
Issue tags: -debian

Automatically closed -- issue fixed for 2 weeks with no activity.