### ### Copyright 2000-2007 University of Illinois Board of Trustees ### All rights reserved. ### ### dtlogin.pm - psgconf module for CDE Login Manager configuration ### ### Campus Information Technologies and Educational Services ### University of Illinois at Urbana-Champaign ### package PSGConf::Control::dtlogin; use strict; use PSGConf::Action::GenerateFile::EnvFile; use PSGConf::Action::RestartDaemon; use PSGConf::Data::Boolean; use PSGConf::Data::Hash; ############################################################################### ### Policy methods ############################################################################### sub _policy_enable_rc { my ($self, $psgconf) = @_; return if ( $psgconf->data_obj('dtlogin_enable')->equals('false') ); if ( $psgconf->data_obj('dtlogin_uses_inittab')->equals('true') ) { $psgconf->data_obj('inittab')->replace_row_cells( { 0 => 'dt_nogb' }, { 2 => 'respawn' } ); } else { $psgconf->data_obj('rc_scripts')->insert( { 'dtlogin' => { 'state' => 'enable' }} ); } } ############################################################################### ### decide() method ############################################################################### sub decide { my ($self, $psgconf) = @_; return if ( $psgconf->data_obj('dtlogin_enable')->equals('false') ); $psgconf->register_actions( PSGConf::Action::GenerateFile::EnvFile->new( name => '/etc/dt/config/Xconfig', description => 'config file for dtlogin', seperator => ":\t", vars => $psgconf->data_obj('dtlogin_options')->get() ), PSGConf::Action::RestartDaemon->new( name => 'dtlogin', pidfile => $psgconf->data_obj('dtlogin_options')->find('Dtlogin.pidFile'), filename => [ '/etc/dt/config/Xconfig' ] ) ); } ############################################################################### ### constructor ############################################################################### sub new { my ($class, $psgconf) = @_; my ($self); $self = {}; bless($self, $class); $self->{name} = 'dtlogin'; $self->{enable} = $self->{name} . '_enable'; $psgconf->register_data( dtlogin_enable => PSGConf::Data::Boolean->new( value => 'false' ), dtlogin_uses_inittab => PSGConf::Data::Boolean->new( value => 'false' ), dtlogin_options => PSGConf::Data::Hash->new() ); $psgconf->register_policy($self, dtlogin_enable_rc_scripts => '_policy_enable_rc', ); return $self; } ############################################################################### ### documentation ############################################################################### 1; __END__ =head1 NAME PSGConf::Control::dtlogin - psgconf module for CDE Login Manager configuration =head1 SYNOPSIS In F: Control PSGConf::Control::dtlogin =head1 DESCRIPTION The B module provides a B control object for configuring the CDE Login Manager. 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 to determine whether or not to write F. =item I A B object to determine how to configure the RC startup script. The two choices are to use I or the I hashes. Defaults to false, which means using the I hash. =item I A B object that contains the options to put into F. =back =item decide() If I is set, instantiates and registers a B object to create F. If the file has been changed, it will also restart the C daemon via the B object. =back =head1 SEE ALSO L L L L L L L =cut