Closed bltierney closed 7 years ago
If you look at the docker build output, you'll see lots of errors on the pscheduler stuff.
Looks like this sort of stuff will need to be scripted and added to the DockerFile:
see: pscheduler-server.spec; the 'build', 'install', 'pre', and 'post' section all have commands that will need to be executed, I think.
see if running "pscheduler internal db-update" will do this.
The above command does not work, and gives this error:
Unable to determine PostgreSQL user.
I assume this script assumes default locations for files, but all files will need to be in something other than /var
Full log of install errors is available here: https://hub.docker.com/r/bltierney/perfsonar4.0-testpoint-docker/builds/bwvswmmk8c4dlw5ebhf59qb/
That error happens when postgresql-load
attempts to determine what user is running PostgreSQL by looking for the server in the process table. Pg needs to be running for the database to be set up.
During the build of the container, try this:
RUN /usr/pgsql-9.5/bin/pg_ctl start
RUN pscheduler internal db-update
RUN /usr/pgsql-9.5/bin/pg_ctl stop
Now it gives this error:
cannot be run as root Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process. I think a script that wraps the init stuff together will be needed.
Probably all you need to do here is run it as postgres
.
Step 8/14 : RUN su postgres -c "/usr/pgsql-9.5/bin/pg_ctl start"
---> Running in d64567def4ff
[91mpg_ctl: no database directory specified and environment variable PGDATA unset Try "pg_ctl --help" for more information.
probably need to do something like this: https://github.com/zokeber/docker-postgresql/blob/master/Dockerfile
But I'm not sure what all 'pscheduler internal db-update' is doing for us.
I updated the Dockerfile, but now I'm getting this error:
RUN pscheduler internal db-update Unable to determine PostgreSQL user.
But I'm not sure what all 'pscheduler internal db-update' is doing for us.
That's what builds or updates the database. The script that does it is structured so you can run it as many times as you want and you'll always wind up with the current version of the database whether you're starting from nothing, have an existing-but-older version or are fully current.
Maybe we should just get together and work on this.
seems to be working now, but more testing needed before closing.
Still need to add commands to initialize postgress for pscheduler use