Bug 22149 - pykota für UCS 3.0
pykota für UCS 3.0
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Printserver - pykota
UCS 2.4
Other Linux
: P5 normal (vote)
: UCS 3.0 - MS2
Assigned To: Felix Botner
Andreas Büsching
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-08 12:30 CEST by Moritz Muehlenhoff
Modified: 2011-12-13 15:50 CET (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Muehlenhoff univentionstaff 2011-04-08 12:30:23 CEST
pykota muss für UCS 3.0 importiert und ggf. auf Python 2.6 angepasst werden.
Comment 1 Stefan Gohmann univentionstaff 2011-05-19 16:03:04 CEST
pykota sollte auch aktualisiert werden.
Comment 2 Stefan Gohmann univentionstaff 2011-05-19 16:32:42 CEST
pykota-1.26+fixes_official ist in UCS 3.0 importiert.
Comment 3 Stefan Gohmann univentionstaff 2011-05-19 16:52:58 CEST
(In reply to comment #2)
> pykota-1.26+fixes_official ist in UCS 3.0 importiert.

Die Versionsnummer beinhaltet unofficial, allerdings ist dies ein offizielles Release. Das sollte nochmal angepasst werden:

$ head -n 1 pykota-1.26_fixes_official/debian/changelog
pykota (1.26_unofficial) unstable; urgency=low
Comment 4 Felix Botner univentionstaff 2011-05-20 16:16:50 CEST
Bei der Installation von univention-prinquotadb kommt es im postinst zu einem Fehler:

Setting up univention-printquotadb (4.0.0-2.39.201105201602) ...
Multifile: /etc/postgresql/8.3/main/pg_hba.conf
Multifile: /etc/postgresql/7.4/main/pg_hba.conf
Reloading PostgreSQL 8.4 database server: main.
psql:/usr/share/pykota/postgresql/pykota-postgresql.sql:33: FEHLER:  neue Kodierung (UTF8) ist inkompatibel mit der Kodierung der Template-Datenbank (SQL_ASCII)
TIP:  Verwenden Sie die gleiche Kodierung wie die Template-Datenbank oder verwenden Sie template0 als Template.
psql:/usr/share/pykota/postgresql/pykota-postgresql.sql:45: \connect: FATAL:  Datenbank >>pykota<< existiert nicht
psql: FATAL:  Datenbank >>pykota<< existiert nicht
psql: FATAL:  Datenbank >>pykota<< existiert nicht
Setting up univention-printquota (4.0.0-2.39.201105201602) ...
File: /etc/pykota/pykotadmin.conf

/usr/share/pykota/postgresql/pykota-postgresql.sql kommt aus dem Paket pykota.
Comment 5 Moritz Muehlenhoff univentionstaff 2011-05-23 12:33:20 CEST
Bei der Übernahme muss für die folgenden vier Patches geprüft werden, ob sie weiterhin übernommen werden müssen:

./pykota/2.4-0-0-ucs/1.22/omit-chsh.patch
./pykota/2.4-0-0-ucs/1.22/sql.patch
./pykota/2.4-0-0-ucs/1.22/20_preinst.patch
./pykota/2.4-0-0-ucs/1.22/updatescript.patch

(Die zwei anderen Patches aus 2.4 sind nicht mehr nötig)
Comment 6 Felix Botner univentionstaff 2011-05-23 17:34:26 CEST
1. omit-chsh.patch - verworfen

diff -aur pykota-1.22.orig/debian/preinst pykota-1.22/debian/preinst
--- pykota-1.22.orig/debian/preinst     2005-06-16 13:20:54.000000000 +0200
+++ pykota-1.22/debian/preinst  2007-08-09 10:09:35.000000000 +0200
@@ -9,7 +9,7 @@
         fi
         if ! id -u pykota > /dev/null 2>&1 ; then
                 adduser --system --home /etc/pykota --ingroup pykota pykota
-                chsh -s /bin/sh pykota
+#                chsh -s /bin/sh pykota
         fi
         if [ "$1" = "upgrade" ]; then
                 cp -a /etc/pykota/pykota.conf /etc/pykota/pykota.conf.saved 2>/dev/null
Nur in pykota-1.22/debian: preinst.~1.1.2.1.~.

"chsh -s /bin/sh pykota" funktioniert

2. 20_preinst.patch - verworfen

diff -Nur pykota-1.22.orig/debian/preinst pykota-1.22/debian/preinst
--- pykota-1.22.orig/debian/preinst     2005-06-16 13:20:54.000000000 +0200
+++ pykota-1.22/debian/preinst  2009-10-24 20:17:20.411462659 +0200
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
 # $Id: preinst,v 1.1.2.1 2005/06/16 11:20:54 stefan Exp $
 
 . /usr/share/debconf/confmodule

3. sql.patch - verworfen

Änderungen sind upstream

4. updatescript.patch - verworfen

Das waren Änderungen für ein Update auf pykto 1.21 (wohl UCS 1.3 -> X). Das sollte bei einer Neuinstallation von UCS 3.0 oder einem Update von 2.4-x auf 3.0 keine Rolle mehr spielen.

KEINE Patches übernommen.
Comment 7 Felix Botner univentionstaff 2011-05-25 17:43:27 CEST
Neuer Patch für die das SQL Skript zum Anlegen der Datenbank. Hier wird nun template0 als Template verwendet, da ein encoding angeben wird (siehe Bug 22592).
Comment 8 Andreas Büsching univentionstaff 2011-09-27 11:54:26 CEST
(In reply to comment #3)
> (In reply to comment #2)
> > pykota-1.26+fixes_official ist in UCS 3.0 importiert.
> 
> Die Versionsnummer beinhaltet unofficial, allerdings ist dies ein offizielles
> Release. Das sollte nochmal angepasst werden:
> 
> $ head -n 1 pykota-1.26_fixes_official/debian/changelog
> pykota (1.26_unofficial) unstable; urgency=low

Das Paket enthält immer noch "unofficial" in der Version

/var/univention/buildsystem2/apt/ucs_3.0-0/all/pykota_1.26+unofficial.24.201108020859_all.deb
Comment 9 Felix Botner univentionstaff 2011-09-27 12:25:55 CEST
Das Changelog wurde per Patch angepasst.
Comment 10 Andreas Büsching univentionstaff 2011-09-28 14:18:44 CEST
(In reply to comment #9)
> Das Changelog wurde per Patch angepasst.

Versionsnummer ist angepasst und ChangeLog existiert
Comment 11 Felix Botner univentionstaff 2011-10-14 15:03:51 CEST
Der Build von pykota wurde auf "dh_pysupport" umgestellt, damit die Python Module an der richtigen Stelle landen.

pkipplib (http://www.pykota.com/software/pkipplib) wird benötigt und wurde nun
paketiert.
Comment 12 Felix Botner univentionstaff 2011-10-14 15:20:27 CEST
univention-printserver/cups-printers.py wurde so angepasst, dass die Drucker, für die das quota deaktiviert wird, auch in pykota gelöscht werden.
Comment 13 Felix Botner univentionstaff 2011-10-14 16:03:05 CEST
Folgende Änderungen waren noch an univention-printquota nötig, damit das Druckquota überhaupt wieder funktioniert:

  * added dependency to pkipplib and pkpgcounter (Bug #21649) 
  * added server password change hook
  * added postgres 8.4 pg_hba.conf subfile template
  * use univention.uldap.getMachineConnection instead of 
    univention.uldap.access in univention-printquota-setuser
  * added listener pykota-groups.py to manage groups in pykota
  * added listener pykota-users.py to manage users in pykota

Achtung, bisher und immer noch werden DruckQuota Richtlinien in pykota nicht aktualisiert, das wird aber an Bug #24065 behandelt.
Comment 14 Andreas Büsching univentionstaff 2011-11-09 16:59:47 CET
Ich hoffe das hier ist der richtige Bug. Es scheint noch etwas mit der Einrichtung der pykota-Datenbank nicht zu stimmen

root@master:~/crunchy/univention-directory-manager-modules# repykota -Plp0
ERROR: PyKota v1.26_fixes_official
ERROR: repykota failed
ERROR: Traceback (most recent call last):
ERROR:   File "/usr/bin/repykota", line 139, in <module>
ERROR:     reportTool.deferredInit()
ERROR:   File "/usr/lib/pymodules/python2.6/pykota/tool.py", line 457, in deferredInit
ERROR:     self.storage = storage.openConnection(self)
ERROR:   File "/usr/lib/pymodules/python2.6/pykota/storage.py", line 866, in openConnection
ERROR:     return storagebackend.Storage(pykotatool, host, database, admin, adminpw)
ERROR:   File "/usr/lib/pymodules/python2.6/pykota/storages/pgstorage.py", line 60, in __init__
ERROR:     raise PGError, msg
ERROR: Error: FATAL:  Passwort-Authentifizierung f?r Benutzer >>pykotaadmin<< fehlgeschlagen
ERROR: FATAL:  Passwort-Authentifizierung f?r Benutzer >>pykotaadmin<< fehlgeschlagen
ERROR:  --- the most probable cause of your problem is that PostgreSQL is down, or doesn't accept incoming connections because you didn't configure it as explained in PyKota's documentation.
r
Comment 15 Felix Botner univentionstaff 2011-11-09 17:37:26 CET
(In reply to comment #14)
> Ich hoffe das hier ist der richtige Bug. Es scheint noch etwas mit der
> Einrichtung der pykota-Datenbank nicht zu stimmen
> 
> root@master:~/crunchy/univention-directory-manager-modules# repykota -Plp0
> ERROR: PyKota v1.26_fixes_official
> ERROR: repykota failed
> ERROR: Traceback (most recent call last):
> ERROR:   File "/usr/bin/repykota", line 139, in <module>
> ERROR:     reportTool.deferredInit()
> ERROR:   File "/usr/lib/pymodules/python2.6/pykota/tool.py", line 457, in
> deferredInit
> ERROR:     self.storage = storage.openConnection(self)
> ERROR:   File "/usr/lib/pymodules/python2.6/pykota/storage.py", line 866, in
> openConnection
> ERROR:     return storagebackend.Storage(pykotatool, host, database, admin,
> adminpw)
> ERROR:   File "/usr/lib/pymodules/python2.6/pykota/storages/pgstorage.py", line
> 60, in __init__
> ERROR:     raise PGError, msg
> ERROR: Error: FATAL:  Passwort-Authentifizierung f?r Benutzer >>pykotaadmin<<
> fehlgeschlagen
> ERROR: FATAL:  Passwort-Authentifizierung f?r Benutzer >>pykotaadmin<<
> fehlgeschlagen
> ERROR:  --- the most probable cause of your problem is that PostgreSQL is down,
> or doesn't accept incoming connections because you didn't configure it as
> explained in PyKota's documentation.
> r

Im Postinst wird eigentlich das Passwort aus "/etc/pykota/pykota.secret" für den Benutzer "pykotaadmin" gesetzt, das scheint aber nicht (mehr) zu klappen.
Als Workaround kann erstmal folgendes gemacht werden:

su - postgres -c "echo \"ALTER USER pykotaadmin PASSWORD '$(< /etc/pykota/pykota.secret)';\" |psql -d pykota"
Comment 16 Felix Botner univentionstaff 2011-11-09 18:03:56 CET
Im postinst von "univention-printquotadb" wird dass Passwort für den postgres Benutzer "pykotaadmin" gesetzt.

su - postgres -c "echo \"ALTER USER pykotaadmin PASSWORD '$secret';\" |psql -d pykota"

Dann aber gleich wieder gelöscht

su - postgres -c "echo \"ALTER USER pykotaadmin PASSWORD '';\" |psql -d pykota"

Das ist natürlich Quatsch. Der zweite "ALTER USER" Befehl wurde nun entfernt.
Comment 17 Andreas Büsching univentionstaff 2011-11-29 14:07:01 CET
(In reply to comment #16)

Das funktioniert jetzt
Comment 18 Sönke Schwardt-Krummrich univentionstaff 2011-12-13 15:50:48 CET
UCS 3.0-0 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte dieser Bug dupliziert
werden: "Clone This Bug"