Xpriori::XMS::ServerUtil::Solaris - subclass of Xpriori::XMS::ServerUtils for Solaris


Xpriori-XMS documentation Contained in the Xpriori-XMS distribution.

Index


Code Index:

NAME

Top

Xpriori::XMS::ServerUtil::Solaris - subclass of Xpriori::XMS::ServerUtils for Solaris

SYNOPSIS

Top

This module is not intended to use directly.

DESCRIPTION

Top

subclass of Xpriori::XMS::ServerUtils for Solaris.

NOTICE

Top

This module has not been tested yet.

AUTHOR

Top

KAWAI,Takanori kwitknr@cpan.org

COPYRIGHT

Top

SEE ALSO

Top

Xpriori::XMS::ServerUtil, Xpriori::XMS::ServerUtil::Win32


Xpriori-XMS documentation Contained in the Xpriori-XMS distribution.

use strict;
package Xpriori::XMS::ServerUtil::Solaris;
#---------------------------------------------------------------------
# new : constructor
#---------------------------------------------------------------------
sub new($)
{
  return bless {}, shift(@_);
}
#---------------------------------------------------------------------
# startServer
#---------------------------------------------------------------------
sub startServer()
{
    my (oSelf) = @_;
    my $iSts = system('/usr/openwin/bin/xterm -e sudo /etc/init.d/neocore start');
    return ($iSts)? 0 : 1;
}
#---------------------------------------------------------------------
# stopServer
#---------------------------------------------------------------------
sub stopServer()
{
    my (oSelf) = @_;
    my $iSts = system('/usr/openwin/bin/xterm -e sudo /etc/init.d/neocore stop');
    return ($iSts)? 0 : 1;
}
#---------------------------------------------------------------------
# createDb
#---------------------------------------------------------------------
sub createDb($$$)
{
  my($oSelf, $sNeoHome, $sPasswd);
  return system('/usr/openwin/bin/xterm -e ' .
       "${sNeoHome}/bin/NeoXMLUtils CreateDB_batch ${sNeoHome}/config ${sPassWd} AC_ON");
}
#---------------------------------------------------------------------
# getStatus
#---------------------------------------------------------------------
sub getStatus()
{
  my (oSelf) = @_;
  open(IN, 
    '/usr/openwin/bin/xterm -e ps -ef | ' .
    'grep NeoServer | grep -v grep | cut -d\"/\" -f6 | cut -c1-9 |')
        or die($!);
  my $sRes = <IN>;
  close IN;
  chomp($sRes);
  return ( $sRes eq 'NeoServer') 1: 0; # server is running or not
}
1;
__END__