### ### Copyright 2000-2007 University of Illinois Board of Trustees ### All rights reserved. ### ### PostgreSQL.pm - PostgreSQL module for psgconf ### ### Campus Information Technologies and Educational Services ### University of Illinois at Urbana-Champaign ### package PSGConf::Control::PostgreSQL; use strict; use PSGConf::Data::Boolean; use PSGConf::Data::List; use PSGConf::Control::Packages qw(_add_pkgs); use PSGConf::Control::syslog qw(_add_syslog); ############################################################################### ### policy methods ############################################################################### sub _policy_add_kernel_params { my ($self, $psgconf) = @_; return if ($psgconf->data_obj('postgresql_enable')->equals('false')); if ($psgconf->data_obj('platform')->match('solaris')) { $psgconf->data_obj('system_vars')->insert( { 'shmsys:shminfo_shmmax' => 2097152 } ) if (! defined $psgconf->data_obj('system_vars')->find('shmsys:shminfo_shmmax')); $psgconf->data_obj('system_vars')->insert( { 'shmsys:shminfo_shmmin' => 1 } ) if (! defined $psgconf->data_obj('system_vars')->find('shmsys:shminfo_shmmin')); } } sub _policy_add_syslog { my ($self, $psgconf) = @_; $self->{facility} = $psgconf->data_obj('postgresql_syslog')->get(); return $self->_add_syslog($psgconf); } ############################################################################### ### Constructor ############################################################################### sub new { my ($class, $psgconf) = @_; my ($self); $self = {}; bless($self, $class); ### So that _add_pkgs knows which directives to look at $self->{name} = 'postgresql'; $self->{enable} = $self->{name} . '_enable'; $self->{packages} = $self->{name} . '_packages'; $self->{syslog} = 'postgres'; $psgconf->register_data( postgresql_enable => PSGConf::Data::Boolean->new( value => 'false' ), postgresql_syslog => PSGConf::Data::String->new( value => 'local2.info' ), postgresql_packages => PSGConf::Data::List->new() ); $psgconf->register_policy($self, pgsql_add_kernel_params => '_policy_add_kernel_params', pgsql_add_syslog => '_policy_add_syslog', pgsql_add_packages => '_add_pkgs' ); return $self; } ############################################################################### ### documentation ############################################################################### 1; __END__ =head1 NAME PSGConf::Control::PostgreSQL - psgconf control class for PostgreSQL =head1 SYNOPSIS In F: Control PSGConf::Control::PostgreSQL =head1 DESCRIPTION The B module provides a B control object for configuring PostgreSQL. It supports the following methods: =over 4 =item new() The constructor. Its parameter is a reference to the B object. It registers the following data objects: =over 4 =item I A B object indicating whether B should be configured. =item I A B object listing all packages that need to be installed. =item I A B object containing the default syslog facility the application logs to. Default is C. =back The constructor also registers the following policy methods: =over 4 =item I Adds C to the I data object (which is supplied by the B module). =item I Adds C to the I data object (which is supplied by the B module). =item I Under Solaris, adds entries to the I object (provided by B) to set C to C<2097152> and C to C<1>. =back =back =head1 SEE ALSO L postmaster(1) L L L L L L L L =cut