[1015] | 1 | # $Id$ |
---|
| 2 | |
---|
[2478] | 3 | PyKota - Print Quotas for CUPS and LPRng |
---|
[1015] | 4 | |
---|
[2622] | 5 | (c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com> |
---|
[1015] | 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2 of the License, or |
---|
| 9 | (at your option) any later version. |
---|
| 10 | |
---|
| 11 | This program is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
| 17 | along with this program; if not, write to the Free Software |
---|
[2303] | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
[1015] | 19 | |
---|
| 20 | ============================================================ |
---|
| 21 | |
---|
| 22 | Documentation for the pykota-postgresql.sql script : |
---|
| 23 | ---------------------------------------------------- |
---|
| 24 | |
---|
| 25 | This script is to be used to create an empty Quota Storage |
---|
| 26 | DataBase using PostgreSQL as a backend. |
---|
| 27 | |
---|
| 28 | If you have already installed PyKota, and have datas in your |
---|
| 29 | Quota Storage DataBase, you may prefer to skip this section |
---|
| 30 | and read the next one. |
---|
| 31 | |
---|
[2817] | 32 | - edit the pykota-postgresql.sql file and modify the passwords on |
---|
| 33 | the 'CREATE USER' lines. |
---|
| 34 | |
---|
[1015] | 35 | - Launch the psql frontend and connect to the |
---|
| 36 | database template1 as a PostgreSQL administrator |
---|
| 37 | (i.e. the postgres user) : |
---|
| 38 | |
---|
[2564] | 39 | as user 'root' : |
---|
| 40 | |
---|
[2817] | 41 | # su - postgres |
---|
[2564] | 42 | |
---|
| 43 | you're now user 'postgres', then continue with : |
---|
| 44 | |
---|
[2817] | 45 | $ psql -h localhost -U postgres -f pykota-postgresql.sql template1 |
---|
[1015] | 46 | |
---|
[2817] | 47 | - If no error message appears, your PostgreSQL PyKota storage |
---|
| 48 | is now ready for use. NB : a lot of NOTICE messages might appear, |
---|
| 49 | this is perfectly normal. |
---|
| 50 | |
---|
| 51 | - In ~pykota/pykota.conf, ensure that the following lines |
---|
| 52 | are present and unique inside the [global] section : |
---|
[1015] | 53 | |
---|
[2817] | 54 | storagebackend : pgstorage |
---|
| 55 | storageserver : localhost |
---|
| 56 | storagename : pykota |
---|
| 57 | storageuser : pykotauser |
---|
| 58 | storageuserpw : readonlypw |
---|
[1015] | 59 | |
---|
[2817] | 60 | NB : replace 'readonlypw' with the password you chose |
---|
| 61 | for user 'pykotauser' when you modified pykota-postgresql.sql |
---|
| 62 | |
---|
| 63 | - In ~pykota/pykotadmin.conf ensure that the following lines |
---|
| 64 | are present and unique inside the [global] section : |
---|
[1015] | 65 | |
---|
[2817] | 66 | storageadmin : pykotaadmin |
---|
| 67 | storageadminpw : readwritepw |
---|
[1015] | 68 | |
---|
[2817] | 69 | NB : replace 'readwritepw' with the password you chose |
---|
| 70 | for user 'pykotaadmin' when you modified pykota-postgresql.sql |
---|
[1015] | 71 | |
---|
[2817] | 72 | - IMPORTANT : if your database is not located on the print server, |
---|
| 73 | replace 'localhost' in the lines above with your database server's |
---|
| 74 | hostname or IP address. If your database server doesn't listen on |
---|
| 75 | its standard port, add the port number at the end of the hostname |
---|
| 76 | with a colon to separate the hostname from the port. |
---|
| 77 | See pykota/conf/pykota.conf.sample for examples. |
---|
| 78 | |
---|
[1015] | 79 | ============================================================ |
---|
| 80 | |
---|
| 81 | Upgrade scripts : |
---|
| 82 | |
---|
[1200] | 83 | DON'T DO ANYTHING IF THIS IS YOUR FIRST INSTALLATION |
---|
| 84 | OF PYKOTA. |
---|
| 85 | |
---|
[1015] | 86 | Some scripts to upgrade old PyKota databases to the new |
---|
| 87 | database schema are included. You may have to run all |
---|
| 88 | of them or only some of them, depending on your |
---|
[2452] | 89 | version of PyKota. Usually running them several times, for |
---|
| 90 | example if you used several different development versions |
---|
| 91 | of PyKota, won't do any harm. |
---|
[1015] | 92 | |
---|
[2564] | 93 | If you're connected as user 'root', you have to be user 'postgres' |
---|
| 94 | instead : |
---|
| 95 | |
---|
[2817] | 96 | # su - postgres |
---|
[2564] | 97 | |
---|
| 98 | You're now user 'postgres', then continue the upgrade by following |
---|
| 99 | the instructions below, depending on the version you actually use : |
---|
| 100 | |
---|
[2452] | 101 | * An SQL script to upgrade a 1.22 PyKota Storage DataBase to |
---|
| 102 | 1.23 is included. Launch it this way on the Quota Storage Server : |
---|
| 103 | |
---|
| 104 | $ psql -U postgres pykota |
---|
| 105 | pykota=# \i upgrade-to-1.23.sql |
---|
| 106 | pykota=# \q |
---|
| 107 | $ |
---|
| 108 | |
---|
| 109 | This script adds many fields to existing tables, and a table to |
---|
| 110 | manage billing codes. |
---|
| 111 | |
---|
[2054] | 112 | * An SQL script to upgrade a 1.20 PyKota Storage DataBase to |
---|
| 113 | 1.21 is included. Launch it this way on the Quota Storage Server : |
---|
| 114 | |
---|
| 115 | $ psql -U postgres pykota |
---|
| 116 | pykota=# \i upgrade-to-1.21.sql |
---|
| 117 | pykota=# \q |
---|
| 118 | $ |
---|
| 119 | |
---|
| 120 | This script adds many fields to existing tables, and also adds |
---|
| 121 | some tables in indexes. |
---|
| 122 | |
---|
[1473] | 123 | * An SQL script to upgrade a 1.18 PyKota Storage DataBase to |
---|
| 124 | 1.19 is included. Launch it this way on the Quota Storage Server : |
---|
| 125 | |
---|
| 126 | $ psql -U postgres pykota |
---|
| 127 | pykota=# \i upgrade-to-1.19.sql |
---|
| 128 | pykota=# \q |
---|
| 129 | $ |
---|
| 130 | |
---|
| 131 | This script adds a field to the print job history. The field that |
---|
| 132 | is added is : hostname |
---|
| 133 | |
---|
[1200] | 134 | * An SQL script to upgrade a pre-1.16 PyKota Storage DataBase to |
---|
| 135 | 1.16 is included. Launch it this way on the Quota Storage Server : |
---|
| 136 | |
---|
| 137 | $ psql -U postgres pykota |
---|
| 138 | pykota=# \i upgrade-to-1.16.sql |
---|
| 139 | pykota=# \q |
---|
| 140 | $ |
---|
| 141 | |
---|
| 142 | This script adds some fields to the print job history, so that |
---|
| 143 | more complete information will be known. The fields that |
---|
[1203] | 144 | are added are : jobprice, filename, title, copies and print |
---|
| 145 | command options. Also some indexes are created to speed things up. |
---|
[1015] | 146 | |
---|
[1200] | 147 | What is below is for historical reasons only, real people don't use |
---|
| 148 | such old beasts, and YOU SHOULDN'T EITHER ! |
---|
| 149 | |
---|
[1079] | 150 | * An SQL script to upgrade a pre-1.14 PyKota Storage DataBase to |
---|
| 151 | 1.14 is included. Launch it this way on the Quota Storage Server : |
---|
| 152 | |
---|
| 153 | $ psql -U postgres pykota |
---|
| 154 | pykota=# \i upgrade-to-1.14.sql |
---|
| 155 | pykota=# \q |
---|
| 156 | $ |
---|
| 157 | |
---|
| 158 | This script adds an "email" field for each user. This field, if not |
---|
| 159 | NULL, is used as the email address of the user when sending warning |
---|
| 160 | messages in case he is over quota. |
---|
| 161 | |
---|
| 162 | * An sql script to upgrade a pre-1.01 PyKota Quota Storage DataBase to |
---|
| 163 | 1.01 is still included for historical reasons. PLEASE DON'T USE IT ! |
---|
| 164 | |
---|
| 165 | * If you are already running an old version of PyKota (<1.03) and |
---|
| 166 | want to upgrade to 1.03, YOU HAVE TO RUN the |
---|
| 167 | upgrade-from-before-1.03.py shell script. NOT LAUNCHING THIS SCRIPT |
---|
| 168 | WILL CAUSE PYKOTA TO STOP WORKING ! PLEASE NEVER RUN THIS SCRIPT IF |
---|
| 169 | YOUR EXISTING VERSION OF PYKOTA IS ALREADY 1.03 OR HIGHER. |
---|