Thread: [Refdb-users] Build Debian bin pkg from Ubunt scr pkg
Status: Beta
Brought to you by:
mhoenicka
|
From: Stefan S. <ste...@ya...> - 2009-09-24 16:25:02
|
Hallo!
I am trying to build a Debian Lenny package from the Ubuntu
package sources provided by Torsten Bronger.
I am a Debian packaging neophyte but after some struggling I
managed to get something named refdb_<..>.deb. The only issue
that I encountered was that I had to use the "libltdl3-dev"
instead of the "libltdl7-dev" as proposed in the "Build-Depends:"
clause, because the "libltdl7-dev" is not available in the Debian
Lenny distribution.
Still the build process worked out fine (although I got a lot of warnings concerning pointers, data types etc.)
After I had manually satisfied the package requirements according to the "Depends:" clause, I issued a "dpkg -i refdb_<..>.deb". Alas the installation process terminated with an error:
...
invoke-rc.d: initscript refdb, action "start" failed.
dpkg: error processing refdb (--install):
subprocess post-installation script returned error exit status 1
...
This made me include a "set -x" in the "/etc/init.d/refdb" file to get a trace. The output of the trace was as follows:
+ start_server
+ '[' '!' -d /var/run/refdb ']'
+ '[' -z refdb ']'
+ start-stop-daemon --start --quiet --pidfile /var/run/refdb/refdbd.pid --chuid refdb --exec /usr/sbin/refdbd -- -L /var/log/refdb/refdbd.log -P /var/run/refdb/refdbd.pid
+ errcode=0
+ return 0
+ '[' -n '' ']'
+ running
+ '[' '!' -f /var/run/refdb/refdbd.pid ']'
++ cat /var/run/refdb/refdbd.pid
+ pid=21573
+ running_pid 21573 /usr/sbin/refdbd
+ pid=21573
+ name=/usr/sbin/refdbd
+ '[' -z 21573 ']'
+ '[' '!' -d /proc/21573 ']'
+ return 1
Obviously the refdb server started but terminated prematurely, so I looked into the "/var/log/refdb/refdbd.log" and found the following message:
6:pid=21573:Thu Sep 24 17:41:19 2009:Available libdbi database drivers:
6:pid=21573:Thu Sep 24 17:41:19 2009:sqlite
3:pid=21573:Thu Sep 24 17:41:19 2009:Requested libdbi driver is not present
I looked for available packages with "libdbi" in their name and got the following listing:
$> aptitude search libdbi
p libdbi-doc - DB Independent Abstraction Layer for C -- documentation
p libdbi-perl - Das Perl5-Datenbank-Interface von Tim Bunce
p libdbi-ruby - Datenbank-unabhängige Schnittstelle für Ruby
p libdbi-ruby1.8 - Datenbankunabhängige Schnittstelle für Ruby 1.8
i A libdbi0 - Database Independent Abstraction Layer for C
i libdbi0-dev - DB Independent Abstraction Layer for C -- development files
p libdbicx-testdatabase-perl - Create a temporary database from a DBIx::Class::Schema
p libdbix-abstract-perl - DBI-SQL-Abstraktion
p libdbix-class-datetime-epoch-perl - Automatic inflation/deflation of epoch-based DateTime objects ...
p libdbix-class-htmlwidget-perl - Like FromForm but with DBIx::Class and HTML::Widget
p libdbix-class-perl - Extensible and flexible object <-> relational mapper
p libdbix-class-schema-loader-perl - Dynamic definition of a DBIx::Class::Schema
p libdbix-contextualfetch-perl - Add context aware fetches to DBI
p libdbix-datasource-perl - Datenbankunabhängige 'create'- und 'drop'-Funktionen
p libdbix-dbschema-perl - Database-independent schema objects
p libdbix-easy-perl - Easy to Use DBI Interface
p libdbix-fulltextsearch-perl - Indexing documents with MySQL as storage
p libdbix-password-perl - Perl module for creating a global password file for DB passwords
p libdbix-profile-perl - DBI-ABfrage-Messungen
p libdbix-recordset-perl - Perl-Erweiterung für DBI-Satzmengen
p libdbix-searchbuilder-perl - Encapsulate SQL queries and rows in simple perl objects
p libdbix-sequence-perl - ein einfacher SQL92-ID-Erzeuger
p libdbix-xml-rdb-perl - perl module for creating XML from a DBI datasource
p libdbix-xmlmessage-perl - perl module for exchanging XML messages between DBI data sources
Which of these packages is missing from my installation?
Kind regards
Stefan
PS: Although required the "autoconf" package is not mentioned in the "Build-Depends:". clause. Explicitly listing may only be necessary in a Debian context, because this package may be automatically installed by other packages in the Ubuntu case - I don't know, but you (Torsten) may want to check this.
|
|
From: Torsten B. <br...@ph...> - 2009-09-24 19:12:03
|
Hallöchen! Stefan Schlee writes: > [...] > > I looked for available packages with "libdbi" in their name and got the > following listing: > > $> aptitude search libdbi > > p libdbi-doc - DB Independent Abstraction Layer for C -- documentation > [...] > p libdbix-xmlmessage-perl - perl module for exchanging XML messages between DBI > data sources > > > Which of these packages is missing from my installation? Du you use the latest version on <https://launchpad.net/~bronger/+ppa-packages>? I switched to the SVN version three weeks ago. It contains Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), openjade, docbook-dsssl, docbook-xml, jadetex, texlive-base-bin, fop, libbtparse0, libtext-iconv-perl, libmarc-record-perl, libxml-parser-perl, libcgi-pm-perl, coreutils, libreadline5, libxml2-utils, xml-core, libncurses5, libdbi0, libdbd-sqlite, libexpat1 Recommends: mysql-server (>= 3.23) | postgresql (>= 7.1) | libsqlite0 (>= 2.8) | libsqlite3-0 (>= 3), libdbd-mysql | libdbd-pgsql | libdbd-sqlite3 The libdbd* packages are important. libdbd-sqlite is always installed, however in your case, this was not enough. Does anybody have an idea why is this? Doesn't RefDB start in Sqlite mode? We could add *all* libdbd's to the dependencies. > [...] > > PS: Although required the "autoconf" package is not mentioned in > the "Build-Depends:". clause. Explicitly listing may only be > necessary in a Debian context, because this package may be > automatically installed by other packages in the Ubuntu case - I > don't know, but you (Torsten) may want to check this. It is built by Launchpad's build service, which starts with a minimal Ubuntu, so I think the builddeps are correct for Ubuntu. I added it nevertheless. Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID: tor...@ja... or http://bronger-jmp.appspot.com |
|
From: Markus H. <mar...@mh...> - 2009-09-25 07:07:53
|
Quoting Torsten Bronger <br...@ph...>: > libdbd-sqlite is always installed, however in your case, this was > not enough. Does anybody have an idea why is this? Doesn't RefDB > start in Sqlite mode? > > We could add *all* libdbd's to the dependencies. > I think it is a good idea to stick to sqlite in the first place, as this allows for the smallest possible installation. According to Stefan's refdbd log "sqlite" is available but this does not seem to be the driver which is requested in refdbdrc. Stefan, could you please post the contents of /etc/refdb/refdbdrc? Does Debian distinguish between sqlite and sqlite3? The latter would be a better default btw. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Stefan S. <ste...@ya...> - 2009-09-28 10:25:29
|
Hallo! Markus Hoenicka writes: > Please have a look at the refdb-init script (also documented here: > http://refdb.sourceforge.net/manual/ch04s08.html) which is a generic > script that may or may not work out of the box on Debian. Sigh ... big shame and a big RFM on me. Installing software via the Debian packaging system obviously made me lazy. So I had a deeper look at the manual and - what a surprise - I seem to have succeeded: After two minor modifications (see below) I seem to have a running refDB server/sqlite3-database: The "/var/lib/refd/db" directory contains the following file: DB_VERSION, refdb, refs (where "refs" is the name of the reference DB that I have selected). I have not yet entered a single reference into my refs reference DB, but I wanted to give you timely feedback. To make a long story short: - I installed the binary package and accepted the error message of the post-installation script that resulted from being unable to start the refdbd server. - After the binary installation I started the "refdb-init" script as root. To execute this script successfully I had to make two minor modifications (Torsten already notes difficulties concerning this script in the README.Debian file of the package.) -- I had the change the value of MYREFDBCTL to "/etc/init.d/refdb" -- I had to execute: "/usr/sbin/refdbd" as root and change the ownership of the "/var/lib/refdb/db" hierarchy afterwards. In concrete, instead of the original: su refdb -c "$MYREFDBD -a -e 0 -l 6 -L /var/log/refdb/refdbd.log -P /var/run/refdb/refdbd.pid -u $dbadmin_name -w $dbadmin_password" || endScript "Failed to install or upgrade main database" "failed" the modified version of the refdb-init script which works in my Debian context contains: $MYREFDBD -a -e 0 -l 6 -L /var/log/refdb/refdbd.log -P /var/run/refdb/refdbd.pid -u $dbadmin_name -w $dbadmin_password || endScript "Failed to install or upgrade main database" "failed" chown -R refdb:refdb /var/lib/refdb/db Note: I first tried: chown refdb:refdb /var/lib/refdb/db su refdb -c "$MYREFDBD -a -e 0 -l 6 -L /var/log/refdb/refdbd.log -P /var/run/refdb/refdbd.pid -u $dbadmin_name -w $dbadmin_password" || endScript "Failed to install or upgrade main database" "failed" but that did not work (denied access to the log/pid files ?) After fiddling with the refdb-init script I have to questions concerning this script: - I do not understand why in the call to refdbd contains the -e flag set to 0 AND the -L flag set. Shouldn't the -e flag be set to 2 in this case or the -L flag be left out? But maybe this means falling back to stderr if the file is not accessible, which is not exactly what the manual says. - In the refdb-init.in file most of the path-names (for example the path-name to the database-directory) are made configurable in the build-process, but this is not the case for the example-configuration files. In the way the software is currently setup there should not arise any inconsistencies. Nevertheless a cleaner solution seems to me to make the example-configuration files configurable in the build-process and to let the refdb-init script read these values from the selected configuration file. If you like I can post a quick and dirty recipe that collects all the steps for building a Debian Lenny package from the refdb_0.9.9.0~svn471-7ubuntu1 Ubuntu source package, installing and purging the Debian binary package. This should probably only be done after I have successfully used the reference database for some time (added references, retrieved them, build bibliographies etc.) Note though that the recipe is currently a make-shift solution: - The approach described in this recipe is VERY dirty indeed. For example: I do not even remove the "ubuntu" string in the package name (this does not mean any hostility against Ubuntu :). - I do not know which of the original shortcomings have already been addressed in a possible new version of Torsten's Ubuntu source package. As I am building and installing in a Debian context, I do not know if these (or which of these) shortcomings should be handled in an Ubuntu package. Kind regards Stefan |
|
From: Markus H. <mar...@mh...> - 2009-09-28 23:02:24
|
Stefan Schlee writes: > - I installed the binary package and accepted the error message of the post-installation script that resulted from being unable to start the refdbd server. > As mentioned in my reply to Torsten, the server could be modified to start but return error messages to each client request as long as the main database has not been created. > - After the binary installation I started the "refdb-init" script as root. To execute this script successfully I had to make two minor modifications (Torsten already notes difficulties concerning this script in the README.Debian file of the package.) > > -- I had the change the value of MYREFDBCTL to "/etc/init.d/refdb" > > -- I had to execute: "/usr/sbin/refdbd" as root and change the ownership of the "/var/lib/refdb/db" hierarchy afterwards. > I guess this amount of porting is acceptable for a binary package. I assume that Debian packages use the same sort of patch collections as BSD ports do to cope with the idiosyncrasies of these OSes. > > > After fiddling with the refdb-init script I have to questions concerning this script: > > - I do not understand why in the call to refdbd contains the -e flag set to 0 AND the -L flag set. Shouldn't the -e flag be set to 2 in this case or the -L flag be left out? But maybe this means falling back to stderr if the file is not accessible, which is not exactly what the manual says. > Which version of RefDB do you use? Actually, I can't find the -L flag being used with refdbd in the current svn revision of refdb-init.in > - In the refdb-init.in file most of the path-names (for example the path-name to the database-directory) are made configurable in the build-process, but this is not the case for the example-configuration files. In the way the software is currently setup there should not arise any inconsistencies. Nevertheless a cleaner solution seems to me to make the example-configuration files configurable in the build-process and to let the refdb-init script read these values from the selected configuration file. I'm not sure whether I can follow you here. The example config files are built from input files. All refdbdrc example config files are built from the same source refdbdrc. Which variables in particular are not adjusted properly? I may have missed something which happens to work on FreeBSD but not on other OSes. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
|
From: Torsten B. <br...@ph...> - 2009-09-29 06:21:50
|
Hallöchen!
Stefan Schlee writes:
> [...]
>
> To make a long story short:
>
> [...]
>
> - After the binary installation I started the "refdb-init" script
> as root.
I don't like that. Unless there are very good reasons, a daemon
should have non-root privileges. RefDB works fine as an ordinary
user.
> To execute this script successfully I had to make two minor
> modifications (Torsten already notes difficulties concerning this
> script in the README.Debian file of the package.)
>
> -- I had the change the value of MYREFDBCTL to
> "/etc/init.d/refdb"
Fixed.
> -- I had to execute: "/usr/sbin/refdbd" as root and change the
> ownership of the "/var/lib/refdb/db" hierarchy afterwards.
Then I have to fix this because this must not be necessary.
Probably it's a Sqlite config issue because with Postgres, the
limited privileges work fine, including properly writing the PID and
the log file.
> [...]
>
> Note: I first tried:
>
> chown refdb:refdb /var/lib/refdb/db
>
> su refdb -c "$MYREFDBD -a -e 0 -l 6 -L /var/log/refdb/refdbd.log -P
> /var/run/refdb/refdbd.pid -u $dbadmin_name -w $dbadmin_password" || endScript
> "Failed to install or upgrade main database" "failed"
>
> but that did not work (denied access to the log/pid files ?)
No, PID and log files are set to permissions which allow the "refdb"
user to write them.
> [...]
>
> - I do not know which of the original shortcomings have already
> been addressed in a possible new version of Torsten's Ubuntu
> source package. As I am building and installing in a Debian
> context, I do not know if these (or which of these) shortcomings
> should be handled in an Ubuntu package.
I didn't do anything except fixing the wrong MYREFDBCTL path above.
I won't have time for it until the weekend.
Anyway, the Ubuntu package must be built in a way that only minimal
modifications are necessary for Debian. I don't have any experience
with packages beyond packaging RefDB, let alone with packaging for
Debian. How is it done normally? Is there one "source" package (my
Ubuntu package in this case) and one "derived" package with a couple
of meta-patches (your Debian package in this case)? How do
packagers organise this?
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: tor...@ja...
or http://bronger-jmp.appspot.com
|