in reply to Start a service, wait 10 seconds, and stop the service.
UPDATE: Ack, no, maybe that wasn't such a good idea. This starts the service, but doesn't stop it, so after a bit of playing around I had a bunch of processes that I had to stop using ctrl-alt-delete. Maybe time to stop monkeying with things I don't really understand and get this working using net start and net stop.use strict; use warnings; use IPC::Open3; #my $result = system("C:\\Programme\\Tor\\tor.exe &"); #print "sleeping"; #sleep(3); my ($WR1, $RD1, $ER1); my $tor_fhs = {}; my $pid = start_tor($tor_fhs); sleep 1; stop_tor($tor_fhs); sub start_tor { my $tor_fhs = shift; open3( $tor_fhs->{wr}, $tor_fhs->{rd}, $tor_fhs->{err}, "C:\\Progr +amme\\Tor\\tor.exe" ); print "tor started\n"; return $pid; } sub stop_tor { my $tor_fhs = shift; close($tor_fhs->{wr}); local($/) = undef; close($tor_fhs->{rd}); #close($ER1); print "tor stopped\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Start a service, wait 10 seconds, and stop the service.
by cool_jr256 (Acolyte) on Jun 17, 2005 at 17:20 UTC | |
|
Re^2: Start a service, wait 10 seconds, and stop the service.
by ikegami (Patriarch) on Jun 17, 2005 at 17:38 UTC |