Skip to content

Instantly share code, notes, and snippets.

@enricostano
Created July 1, 2016 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enricostano/6bc2042c69d8a5a9ae8174df19a6a6dd to your computer and use it in GitHub Desktop.
Save enricostano/6bc2042c69d8a5a9ae8174df19a6a6dd to your computer and use it in GitHub Desktop.
$ ./launcher bootstrap app
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2016-07-01T15:04:18.921045 #14] INFO -- : Loading --stdin
I, [2016-07-01T15:04:18.947521 #14] INFO -- : > mkdir -p /shared/postgres_run
I, [2016-07-01T15:04:18.952471 #14] INFO -- :
I, [2016-07-01T15:04:18.953363 #14] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2016-07-01T15:04:18.957958 #14] INFO -- :
I, [2016-07-01T15:04:18.958930 #14] INFO -- : > chmod 775 /shared/postgres_run
I, [2016-07-01T15:04:18.962453 #14] INFO -- :
I, [2016-07-01T15:04:18.963144 #14] INFO -- : > rm -fr /var/run/postgresql
I, [2016-07-01T15:04:18.967276 #14] INFO -- :
I, [2016-07-01T15:04:18.968070 #14] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2016-07-01T15:04:18.971838 #14] INFO -- :
I, [2016-07-01T15:04:18.972520 #14] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2016/07/01 15:04:19 socat[22] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2016-07-01T15:04:19.047980 #14] INFO -- :
I, [2016-07-01T15:04:19.048824 #14] INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2016-07-01T15:04:19.055195 #14] INFO -- :
I, [2016-07-01T15:04:19.056192 #14] INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2016-07-01T15:04:19.061181 #14] INFO -- :
I, [2016-07-01T15:04:19.062100 #14] INFO -- : > mkdir -p /shared/postgres_run/9.5-main.pg_stat_tmp
I, [2016-07-01T15:04:19.066155 #14] INFO -- :
I, [2016-07-01T15:04:19.067039 #14] INFO -- : > chown postgres:postgres /shared/postgres_run/9.5-main.pg_stat_tmp
I, [2016-07-01T15:04:19.071275 #14] INFO -- :
I, [2016-07-01T15:04:19.080036 #14] INFO -- : File > /etc/service/postgres/run chmod: +x
I, [2016-07-01T15:04:19.088564 #14] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x
I, [2016-07-01T15:04:19.097233 #14] INFO -- : File > /root/upgrade_postgres chmod: +x
I, [2016-07-01T15:04:19.098406 #14] INFO -- : > chown -R root /var/lib/postgresql/9.5/main
I, [2016-07-01T15:04:19.291460 #14] INFO -- :
I, [2016-07-01T15:04:19.291940 #14] INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/9.5/bin/initdb -D /shared/postgres_data || exit 0
I, [2016-07-01T15:04:19.295608 #14] INFO -- :
I, [2016-07-01T15:04:19.296288 #14] INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2016-07-01T15:04:19.301353 #14] INFO -- :
I, [2016-07-01T15:04:19.302051 #14] INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2016-07-01T15:04:19.306974 #14] INFO -- :
I, [2016-07-01T15:04:19.308013 #14] INFO -- : > /root/upgrade_postgres
cat: /shared/postgres_data/PG_VERSION: No such file or directory
initdb: invalid locale settings; check LANG and LC_* environment variables
I, [2016-07-01T15:04:19.439259 #14] INFO -- : Upgrading PostgreSQL to from version to 9.5
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
I, [2016-07-01T15:04:19.439755 #14] INFO -- : > rm /root/upgrade_postgres
I, [2016-07-01T15:04:19.443137 #14] INFO -- :
I, [2016-07-01T15:04:19.443740 #14] INFO -- : Replacing data_directory = '/var/lib/postgresql/9.5/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.444970 #14] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.445957 #14] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.446814 #14] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.447754 #14] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.448670 #14] INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.449363 #14] INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2016-07-01T15:04:19.454037 #14] INFO -- :
I, [2016-07-01T15:04:19.454924 #14] INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = $db_max_wal_senders in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.455876 #14] INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = $db_wal_level in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.456800 #14] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.457567 #14] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.458879 #14] INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/9.5/main/postgresql.conf
I, [2016-07-01T15:04:19.461455 #14] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/9.5/main/pg_hba.conf
I, [2016-07-01T15:04:19.462702 #14] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/9.5/main/pg_hba.conf
I, [2016-07-01T15:04:19.463768 #14] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main
I, [2016-07-01T15:04:19.466314 #14] INFO -- : > sleep 5
LOG: skipping missing configuration file "/shared/postgres_data/postgresql.auto.conf"
2016-07-01 15:04:19 UTC [49-2] FATAL: data directory "/shared/postgres_data" has group or world access
2016-07-01 15:04:19 UTC [49-3] DETAIL: Permissions should be u=rwx (0700).
I, [2016-07-01T15:04:24.469867 #14] INFO -- :
I, [2016-07-01T15:04:24.470566 #14] INFO -- : > su postgres -c 'createdb discourse' || true
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "es_ES.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
createdb: could not connect to database template1: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2016-07-01T15:04:24.681603 #14] INFO -- :
I, [2016-07-01T15:04:24.682101 #14] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "es_ES.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2016-07-01T15:04:24.912664 #14] INFO -- :
I, [2016-07-01T15:04:24.913266 #14] INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "es_ES.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2016-07-01T15:04:25.142131 #14] INFO -- :
I, [2016-07-01T15:04:25.142558 #14] INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "es_ES.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2016-07-01T15:04:25.371599 #14] INFO -- :
I, [2016-07-01T15:04:25.372225 #14] INFO -- : Terminating async processes
FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 75 exit 2>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
78eab47d79756277cc8dcc8cddd9cb3f3de30469cad5d3640bd2f2affa215d6e
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment