writing a perl service [ and making it hidden]

writing a perl service [ and making it hidden]

am 22.02.2007 21:40:47 von james.burchell

To all,

Is there a way to write a perl application
and let it run as a service [ without using
SRVANY or other proprietary tool] ?

I've been looking and cannot see it.

An example might be a program that looks
at a directory and watches for a file to appear.

Can the service be hidden ?


Thanks in advance,

James Burchell
==========================================
"Believing something doesn't make it true;
refusing to believe it doesn't make it false."
- Paul Little
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: writing a perl service [ and making it hidden]

am 22.02.2007 22:53:46 von Trevor Joerges

Burchell, James wrote:
> To all,
>
> Is there a way to write a perl application
> and let it run as a service [ without using
> SRVANY or other proprietary tool] ?
>
> I've been looking and cannot see it.
>
> An example might be a program that looks
> at a directory and watches for a file to appear.
>
> Can the service be hidden ?
>
>
> Thanks in advance,
>
> James Burchell
> ==========================================
> "Believing something doesn't make it true;
> refusing to believe it doesn't make it false."
> - Paul Little
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
>
Roth Consulting maintains a Perl module called Win32::Daemon that allows
you do to what you want although I do not know the answer to the
question if a service can be hidden. I don't think that is a feature of
Windows but perhaps there is a way to do it.

http://www.roth.net/perl/Daemon/

HTH,
Trevor Joerges
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: writing a perl service [ and making it hidden]

am 22.02.2007 23:08:56 von Tom.Browder

For Unix/Linuz a crude way I've done it for single user systems is to
have a process started and put into the background when the user logs
in. For example, in /etc/profile.d/fake_server_prog.csh put the line

/etc/fake_server_prog.pl &

where fake_server_prog.pl is my perl program and I keep it in the /etc
directory.

I'm sure there are vulnerabilities but my systems are not connected to a
network and they are well protected physically.

But I know there are much better ways to do it, and probably a way to
start the prog as a daemon. Have you looked at the Perl Cookbook?

-Tom
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: writing a perl service [ and making it hidden]

am 23.02.2007 09:01:50 von ken1

> Is there a way to write a perl application
> and let it run as a service [ without using
> SRVANY or other proprietary tool] ?

Not really, if it's truly a service as defined by Windows, you want.
Services use a specific API for interacting with the OS, and perl.exe simply
doesn't make use of those.

But if you can overcome the hesitation to use a proprietary tool, look into
the ActiveState PDK (Perl Dev Kit). It has great support for 'compiling' a
Perl app into a 'real' service, implementing the specific startup
entrypoints, support for handling start/stop/pause etc etc as used for
services.

Note that you really need a service in order to make it start at boot and
'always' be available & survive logons/logoffs (well, in principle; if
you're really determined you can probably find other ways to spawn a process
of your own during bootup but I wouldn't recommend that).

> Can the service be hidden ?

No.

That is, unless you want to implement and foist a root kit based thingie on
your users...http://en.wikipedia.org/wiki/Rootkit. Not recommended.

HTH,

ken1

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs