[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Dak bug report



On 09/15/2012 04:45 PM, Travis L. Bean wrote:
On 09/15/2012 05:06 AM, Adam D. Barratt wrote:
On Sat, 2012-09-01 at 22:30 -0700, Travis L. Bean wrote:
I recently ran into an error condition (everything was working fine
until just recently). Please let me know if something changed in the
last month in the Dak source code that needs to be updated in this
dak.sh script.

Quite a bit changed in the last month or so - see
http://lists.debian.org/87628efz2l.fsf@marvin.43-1.org

In terms of your specific error:

Please add Dir::Base to dak.conf and try the update again.

I had originally attempted to add "Dir::Base" to /srv/dak/dak.conf by
appending it (echo Dir::Base >> dak.conf) to the bottom of the file
without any luck and finally wised up with the following:

sed -i '1 i\Dir::Base' /srv/dak/dak.conf

Now "~dak/bin/dak update-db" completes successfully.

I still get an error condition when using "~dak/bin/dak init-dirs" to
create the initial /srv/dak tree:

Traceback (most recent call last):
   File "/home/dak/bin/dak", line 237, in <module>
     main()
   File "/home/dak/bin/dak", line 217, in main
     module.main()
   File "/opt/dak/dak/init_dirs.py", line 184, in main
     create_directories()
   File "/opt/dak/dak/init_dirs.py", line 111, in create_directories
     process_tree(Cnf, "Dir")
   File "/opt/dak/dak/init_dirs.py", line 70, in process_tree
     do_dir(target, config_name)
   File "/opt/dak/dak/init_dirs.py", line 54, in do_dir
     os.makedirs(target)
   File "/usr/lib/python2.6/os.py", line 157, in makedirs
     mkdir(name, mode)
OSError: [Errno 2] No such file or directory: ''

Dak is back to functioning again. A big thanks to the geniuses who fixed this bug!

Here is a working Dak installer script:

#!/bin/bash

# This script installs Dak on Debian Squeeze 6.x.

# Adjust variables to match your configuration:
ARCH="amd64"
NAME="John Doe, Jr."
EMAIL="jdoe@example.com"

# Install Dak:
echo "deb http://www.backports.org/debian squeeze-backports main contrib non-free" \
  > /etc/apt/sources.list.d/backports.list
apt-get update
apt-get -t squeeze-backports -y install postgresql-doc-9.1 postgresql-9.1 \
  postgresql-client-9.1 postgresql-plperl-9.1 postgresql-plpython-9.1 \
  postgresql-9.1-debversion python-psycopg2 python-sqlalchemy python-apt \
binutils-multiarch python-yaml python-ldap python-pyrss2gen python-rrdtool \
  python-debian dpkg-dev lintian less symlinks git gnupg rng-tools
git clone http://ftp-master.debian.org/git/dak.git /opt/dak

# Set up the Dak user:
addgroup --system ftpmaster
adduser --system dak --ingroup ftpmaster --shell /bin/bash

# Create postgres roles and database:
su -l postgres -c psql << EOF.postgres
CREATE USER dak CREATEROLE;
CREATE ROLE ftpmaster;
CREATE ROLE ftpteam WITH ROLE ftpmaster;
CREATE ROLE ftptrainee WITH ROLE ftpmaster, ftpteam;

CREATE DATABASE projectb WITH OWNER dak TEMPLATE template0 ENCODING 'SQL_ASCII';
\c projectb
CREATE EXTENSION IF NOT EXISTS plpgsql;
CREATE EXTENSION IF NOT EXISTS debversion;
EOF.postgres

# Set up the Dak directory:
mkdir -p /etc/dak
mkdir -p /srv/dak
chown dak:ftpmaster /srv/dak
chmod 2775 /srv/dak

# Create a symlink to /srv/dak/dak.conf in /etc/dak:
ln -fs /srv/dak/dak.conf /etc/dak/dak.conf

# Import the schema:
su dak -c "psql -1 -f /opt/dak/setup/current_schema.sql -d projectb >/dev/null"

# Set up some core data in projectb to get started (read the init_vars
# file if you wish to customize various aspects):
cd /opt/dak/setup
su dak -c "sh init_core"

# Create a minimal dak.conf:
su dak -c "sh init_minimal_conf > /srv/dak/dak.conf"

# Set up a symlink for dak.py:
su dak -c "mkdir -p ~dak/bin"
su dak -c "ln -fs /opt/dak/dak/dak.py ~dak/bin/dak"

# Test that the database schema is up-to-date:
su dak -c "~dak/bin/dak update-db"

# Run dak init-dirs to set up the initial /srv/dak tree:
su dak -c "~dak/bin/dak init-dirs"

# Copy the email templates into the /srv/dak tree:
cp -u /opt/dak/templates/* /srv/dak/templates/

# Create GnuPG private key to sign APT repositories:
GPG_ID=$((
rngd -r /dev/urandom
su dak -c "gpg --no-default-keyring --secret-keyring \
  /srv/dak/keyrings/s3kr1t/dot-gnupg/secring.gpg --keyring \
/srv/dak/keyrings/s3kr1t/dot-gnupg/pubring.gpg --gen-key --batch" << EOF.gpg
Key-Type: RSA
Key-Length: 2048
Expire-Date: 0
Name-Real: $NAME
Name-Email: $EMAIL
EOF.gpg
killall rngd
) 2>&1 | grep "gpg: key" | awk '{ print $3 }')

# Add the architecture you care about:
su dak -c "~dak/bin/dak admin architecture add $ARCH "$ARCH port""

# Add a suite (origin=, label= and codename= are optional)
# signingkey= will ensure that Release files are signed:
su dak -c "~dak/bin/dak admin suite add-all-arches stable \
  $(cat /etc/debian_version) signingkey=${GPG_ID}"

# Re-run Dak init-dirs to add new suite directories to /srv/dak:
su dak -c "~dak/bin/dak init-dirs"

--
Travis L. Bean
http://www.AssureTech.net
AssureTech - Your source for FREE Open Source


Reply to: