CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Using Win32::service module

 



anamika
Deleted

Jul 20, 2000, 2:21 PM

Post #1 of 5 (6329 views)
Using Win32::service module Can't Post

hello,

Pls can somebody tell how to use this module
i have used it in my package but not got the
result. pls help.

Also any existing module to resolve the NT and UNIX Operating system issues. checked
CPAN - did not find any. if anybody aware
of module. please provide links to the source.

Thanks


dws
Deleted

Jul 20, 2000, 2:39 PM

Post #2 of 5 (6329 views)
Re: Using Win32::service module [In reply to] Can't Post

Post a code fragment that shows how you're trying to use the module.

And please try to be more specific on the second question. "Resolve the NT and Unix Operating system issues" is too vague. What issues are you tring to resolve?


anamika
Deleted

Jul 21, 2000, 6:36 AM

Post #3 of 5 (6329 views)
Re: Using Win32::service module [In reply to] Can't Post

i have tried to get the services running on my NT box and also i want to get the status
of running service but i am not able to.

i have said
use Win32::Services and also used the functions in this module - the Get services and the Get status .

Any clues.

i have the module installed in the library- i
checked that out.



saravanansrivai
Deleted

Aug 1, 2000, 12:54 PM

Post #4 of 5 (6329 views)
Re: Using Win32::service module [In reply to] Can't Post

These are routines i have used on my script for starting & stopping & Getting the status of "mysql" service.U can customize it for any service.

Win32::Service;

#### Check mysql service status,return true if the servcie is running
sub mysqlStatus {

## Check Win32 Services

#Win32::Service::GetServices("",\%srvs);

Win32::Service::GetStatus("",$srv,\%status);
#print ("Service= $srv\n\n");
#foreach $key2 (sort keys %status) {print ("Status=$key2===>$status{$key2}\n");}
if ($status{'CurrentState'}==4){print "Mysql service is Running!!!\n";return 1;} else {print "Mysql service is not Running!!!\n";return 0;}
}

#### Stop mysql service status,return true if the servcie is Stopped
sub mysqlStop {
print "Stopping Mysql service !!!\n";
print ACTLOG ("Stopping Mysql service !!!\n");
Win32::Service::StopService("","$srv");
Win32::Service::GetStatus("","$srv",\%status);

if ($my_srv{CurrentState}==1) {
return 1;
} else {
return 0;}
}

#### Start mysql service status,return true if the servcie is Started
sub mysqlStart {
print "Starting Mysql service !!!\n";
print ACTLOG ("Starting Mysql service !!!\n");
Win32::Service::StartService("","$srv");
Win32::Service::GetStatus("","$srv",\%status);

if ($my_srv{CurrentState}==4) {
return 1;
} else {
return 0;}
}



anamika
Deleted

Aug 1, 2000, 10:04 PM

Post #5 of 5 (6329 views)
Re: Using Win32::service module [In reply to] Can't Post

hello,

thanx - i got the result by using the win32::services this is using the service names- i used the srvice display name earlier

thanks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives