Skip to content

Commit

Permalink
Initial pgtune.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Jun 3, 2012
1 parent e8395fe commit 20e101c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
Empty file added pgtune/config/checksum
Empty file.
3 changes: 3 additions & 0 deletions pgtune/config/defaults
@@ -0,0 +1,3 @@
base_url=http://pgfoundry.org/frs/download.php/2449
version=0.9.3
archive_format=tar.gz
23 changes: 23 additions & 0 deletions 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"
}

Empty file added pgtune/shell/includes
Empty file.
Empty file added pgtune/shell/initialize
Empty file.
12 changes: 8 additions & 4 deletions postgresql/shell/functions
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 20e101c

Please sign in to comment.