From 20e101cf7fcb9a7bbeda2bc6166014b2b204b30e Mon Sep 17 00:00:00 2001 From: "Wayne E. Seguin" Date: Sun, 3 Jun 2012 14:13:47 -0400 Subject: [PATCH] Initial pgtune. --- pgtune/config/checksum | 0 pgtune/config/defaults | 3 +++ pgtune/shell/functions | 23 +++++++++++++++++++++++ pgtune/shell/includes | 0 pgtune/shell/initialize | 0 postgresql/shell/functions | 12 ++++++++---- 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 pgtune/config/checksum create mode 100644 pgtune/config/defaults create mode 100644 pgtune/shell/functions create mode 100644 pgtune/shell/includes create mode 100644 pgtune/shell/initialize diff --git a/pgtune/config/checksum b/pgtune/config/checksum new file mode 100644 index 0000000..e69de29 diff --git a/pgtune/config/defaults b/pgtune/config/defaults new file mode 100644 index 0000000..f4ae661 --- /dev/null +++ b/pgtune/config/defaults @@ -0,0 +1,3 @@ +base_url=http://pgfoundry.org/frs/download.php/2449 +version=0.9.3 +archive_format=tar.gz diff --git a/pgtune/shell/functions b/pgtune/shell/functions new file mode 100644 index 0000000..468f8cf --- /dev/null +++ b/pgtune/shell/functions @@ -0,0 +1,23 @@ +#!/bin/sh + +pgtune_configure() +{ + : # nothing to do, pgtune is a script. +} + +pgtune_build() +{ + : # nothing to do, pgtune is a script. +} + +pgtune_install() +{ + file copy from "${source_path}/pgtune" to "${install_path}/bin/pgtune" + + paths create "${install_path}/bin" + + log "#installing ${package_name} ${package_version}...\n" + + install -b "pgtune" "${install_path}/bin/pgtune" +} + diff --git a/pgtune/shell/includes b/pgtune/shell/includes new file mode 100644 index 0000000..e69de29 diff --git a/pgtune/shell/initialize b/pgtune/shell/initialize new file mode 100644 index 0000000..e69de29 diff --git a/postgresql/shell/functions b/postgresql/shell/functions index cfa16b6..d28fa93 100644 --- a/postgresql/shell/functions +++ b/postgresql/shell/functions @@ -80,7 +80,8 @@ postgresql_defaults() fi if [[ ${service_user} == "postgresql" ]] - then service_user="postgres" ; fi + then service_user="postgres" + fi config read file "defaults" key "version" prefix "package" from "postgresql" service_data_path="/var/db/postgresql/${package_version}/data" @@ -176,10 +177,12 @@ postgresql_database_initialize() if user is root then if ! su - "${service_user}" -c "${_command}" - then __sm.log.warn "initdb failed, command:\n${_command}" ; fi + then __sm.log.warn "initdb failed, command:\n${_command}" + fi else if ! eval "${_command}" - then __sm.log.warn "initdb failed, command:\n${_command}" ; fi + then __sm.log.warn "initdb failed, command:\n${_command}" + fi fi fi @@ -188,7 +191,8 @@ postgresql_database_initialize() for _dir in archives wal do if ! path exists "${service_data_path}/${_dir}" - then paths create "${service_data_path}/${_dir}" ; fi + then paths create "${service_data_path}/${_dir}" + fi done fi