Hi Thorsten,
> Nice work, I used SCMBug as a service with srvany, so I'm interested
> about if your resolution has the same drawbacks.
>
>> sub Callback_Stop {
>> EventLog("$svcinfo->{display} stopping");
>> Win32::Daemon::State( SERVICE_STOPPED );
>> Win32::Daemon::StopService();
>> }
>
> This looks like that if the deamon ist stopped there's no indication
> if the deamon processes any messages or else, it's just terminated,
> right? That's the case with srvany of course, which just kills
> the perl process for SCMBug, but at least with your resolution one is
> once able to detect if the deamon is processing something. Or how does
> StopService work? The docs only states "This will instruct the service
> to terminate.", but I can't the any former event handler or something
> like that, where the deamon could get the info that he may stop
> working in a "clean" way.
Yes, the perl-process is simply killed in this proof-of-concept. To
support a clean shutdown daemon threads would need to be signaled and
monitored. This requires some sychronization primitives (wait/notify
primitives would be nice). Because I'm not that proficient in perl, I
need to investigate what's available.
I haven't tested in Linux whether the scmbug daemon shutdowns cleanly. I
reckon it depends on how threads and signals are handled there.
Kind regards,
Roger
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users