2014-05-20 Ramon Novoa <rnovoa@artica.es>
* bin/pandora_server: Stop the service when the server crashes (win32). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9963 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
954ea7f186
commit
2135f4fe72
|
@ -1,3 +1,7 @@
|
|||
2014-05-20 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* bin/pandora_server: Stop the service when the server crashes (win32).
|
||||
|
||||
2014-05-13 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* bin/pandora_server: Added support to run as a native win32 service.
|
||||
|
|
|
@ -148,6 +148,8 @@ sub pandora_crash () {
|
|||
# worried about that. If perl has a more "clean" way to avoid this messages
|
||||
# will be nice to replace this code, but at this time it's the only way I know
|
||||
|
||||
callback_stop() if (defined($Config{'__win32_service__'}));
|
||||
|
||||
foreach my $error_line (@_) {
|
||||
# Trap the XML error and exit without nasty messages
|
||||
if ($error_line =~ m/XML\/Parser/) {
|
||||
|
@ -471,7 +473,7 @@ sub parse_options {
|
|||
} elsif ($service_action eq 'uninstall') {
|
||||
win32_uninstall_service();
|
||||
} elsif ($service_action eq 'run') {
|
||||
win32_service_run;
|
||||
$Config{'__win32_service__'} == 1;
|
||||
} else {
|
||||
error("Unknown action: $service_action");
|
||||
}
|
||||
|
@ -622,8 +624,14 @@ sub main() {
|
|||
}
|
||||
|
||||
# Parse command line options.
|
||||
parse_options;
|
||||
parse_options();
|
||||
|
||||
# Run as a regular process.
|
||||
main();
|
||||
if (!defined($Config{'__win32_service__'})) {
|
||||
main();
|
||||
}
|
||||
# Run as a Windows service.
|
||||
else {
|
||||
win32_service_run();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue