Re: [Refdb-users] refdb-init help
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mar...@mh...> - 2019-03-21 23:20:18
|
On 2019-03-21 11:20, Michael Strack was heard to say: > Trying to wrap up installation with the refdb-init script on and off > over the past couple of weeks, getting the following errors: > > #+BEGIN_QUOTE > Saved existing refdbd configuration file as > /usr/local/etc/refdb/refdbdrc.201903191931.16 > scripts/refdb-init: line 410: refdbdrc.example: No such file or > directory > /usr/local/bin/refdbd: option requires an argument -- 'w' > unknown option w: use refdbd -h to display usage > > Check for PostgreSQL authentication problems > > refdbd-init.sh failed. > refdb-init is finished. > #+END_QUOTE > > Environment: > > - SVN version of refdb > - Debian > - Using PostgreSQL as back-end > > First, the missing file. This may be because of the following code in > refdb-init (around line 410, as it said): > > #+BEGIN_SRC > if [ "${engine_name}" = "mysql" ]; then > sed "s%<refdblib>%/usr/local/share/refdb%" < > /usr/local/etc/refdb/refdbdrc.mysql.example | \ > sed "s/\tlocalhost/\t${refdbdrc_hostname}/" | \ > sed "s/\t3306/\t${refdbdrc_port}/">/usr/local/etc/refdb/refdbdrc \ > || endScript "Could not create refdbd config file" "failed" > elif [ "${engine_name}" = "pgsql" ]; then > sed "s%<refdblib>%/usr/local/share/refdb%" < refdbdrc.example | \ > sed "s/\tlocalhost/\t${refdbdrc_hostname}/" | \ > sed "s/\t5432/\t${refdbdrc_port}/" >/usr/local/etc/refdb/refdbdrc \ > || endScript "Could not create refdbd config file" "failed" > #+END_SRC > > You can see that in the mysql case, the database-specific file > 'refdbdrc.mysql.example' is used, while in the PostgreSQL case, the > non-existent generic file 'refdbdrc.example' is referenced. Perhaps > this should instead refer to 'refdbdrc.pgsql.example', which /does/ > exist? > > As for PostgreSQL authentication issues, the relevant call to refdbd > in refdb-init seems to be: > > #+BEGIN_SRC > if [ "${engine_name}" = "pgsql" ]; then > su $postgres_name -c "$MYREFDBD -a -e 0 -l 6 -u $dbadmin_name -w > $dbadmin_password" || endScript "Check for PostgreSQL authentication > problems" "failed" > #+END_SRC > > Have tested general functioning of PostgreSQL from shell and it seems > to work fine. The default PostgreSQL installation on Debian has a > single database admin and super user account, 'postgres', which is > locked. No password, can only be access by su/sudo. I figured since > I run refdb-init as root, this would be handled. So I just pass this > username and a blank password to refdb-init. But maybe I am required > to set a password for the admin account? > > I've tried passing a blank (i.e. hitting RETURN), empty quotes (''), > an asterisk (*), a quoted asterisk ('*'). Sometimes this prompts for > password, sometimes it gives me "cannot open PID file"... > Hi, I think your analysis regarding the .example file is correct. This is a leftover of an older version which customized a single template instead of using one template per database engine. I've checked in the fixed version of refdb-init.in. Remember that you have to re-run configure in order to create a fixed refdb-init. I can't tell off the top of my head if refdb-init can handle database logins without a password. Even if superuser access is restricted to a dedicated account, I think it is still recommended to set a superuser database password before doing anything interesting with the database. I can't guarantee this will fix your initialization problem, but it seems to be the proper way for security reasons anyway. If nothing else helps, please follow the steps of the handbook for manual initialization. best regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |