sysctl should apply immediately?
Otherwise, postgres cannot always start, making all sorts of things fail during reconfigure.
2015-10-26_16:21:15.70532 FATAL: could not create shared memory segment: Invalid argument
2015-10-26_16:21:15.70533 DETAIL: Failed system call was shmget(key=5432001, size=280469504, 03600).
2015-10-26_16:21:15.70533 HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 280469504 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
2015-10-26_16:21:15.70533 If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
2015-10-26_16:21:15.70534 The PostgreSQL documentation contains more information about shared memory configuration.
2015-10-26_16:21:16.72458 FATAL: could not create shared memory segment: Invalid argument
2015-10-26_16:21:16.72459 DETAIL: Failed system call was shmget(key=5432001, size=280469504, 03600).
2015-10-26_16:21:16.72460 HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 280469504 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
2015-10-26_16:21:16.72460 If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
2015-10-26_16:21:16.72460 The PostgreSQL documentation contains more information about shared memory configuration.
2015-10-26_16:21:17.81445 LOG: database system was interrupted; last known up at 2015-10-16 10:19:46 GMT
2015-10-26_16:21:17.81689 LOG: database system was not properly shut down; automatic recovery in progress
2015-10-26_16:21:17.81846 LOG: record with zero length at 0/1A09020
2015-10-26_16:21:17.81847 LOG: redo is not required
2015-10-26_16:21:17.82647 LOG: database system is ready to accept connections
2015-10-26_16:21:17.82737 LOG: autovacuum launcher started
Recipe: gitlab::unicorn
* service[unicorn] action restart
- restart service service[unicorn]
Recipe: gitlab::sidekiq
* service[sidekiq] action restart
- restart service service[sidekiq]
Recipe: gitlab::gitlab-rails
* execute[clear the gitlab-rails cache] action run
- execute /opt/gitlab/bin/gitlab-rake cache:clear
Recipe: gitlab::unicorn
* execute[load sysctl conf] action run
- execute cat /etc/sysctl.conf /etc/sysctl.d/*.conf | sysctl -e -p -
Running handlers:
[2015-10-26T17:21:17+01:00] ERROR: Running exception handlers
Running handlers complete
[2015-10-26T17:21:17+01:00] ERROR: Exception handlers complete
Chef Client failed. 19 resources updated in 88.829819721 seconds
[2015-10-26T17:21:17+01:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
[2015-10-26T17:21:17+01:00] ERROR: execute[create gitlab database user] (gitlab::postgresql line 153) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" ----
STDOUT:
STDERR: psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
---- End output of /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" ----
Ran /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" returned 2
[2015-10-26T17:21:18+01:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Note sysctls being applied in the tail of the chef run, after it errored out. Also note Postgres starting up in the end.