Make newlisp app be a windows service?

Q&A's, tips, howto's
Locked
csfreebird
Posts: 107
Joined: Tue Jan 15, 2013 11:54 am
Location: China, Beijing
Contact:

Make newlisp app be a windows service?

Post by csfreebird »

I wish I could install one newlisp app as windows service. Then it could watch over my other processes, make sure they are all alive.
How to do this?

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: Make newlisp app be a windows service?

Post by HPW »

I think you will need a programming enviroment/language that can compile such Service app-target.
And this app might use the dll-flavour of newlisp for executing the wanted lsp.

Example tutorial for Delphi:
http://www.tolderlund.eu/delphi/service/service.htm
Hans-Peter

csfreebird
Posts: 107
Joined: Tue Jan 15, 2013 11:54 am
Location: China, Beijing
Contact:

Re: Make newlisp app be a windows service?

Post by csfreebird »

Thanks. From your idea, I got my solution. Just install one bat file as windows service, and this bat file call my newlisp script file.
For example, My daemon.lsp file is:

Code: Select all

(while true
       (println "hello, I am daemon")
       (append-file "c:\\t.txt" "mm")
       (sleep 1000))
And my daemon.bat file has:

Code: Select all

newlisp C:\windows_service\daemon.lsp
Now, download nssm.exe from http://nssm.cc/download/?page=download
Install this daemon.bat as windows service with the following command:

Code: Select all

nssm install my_daemon C:\windows_service\daemon.bat 

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: Make newlisp app be a windows service?

Post by HPW »

Hello,

Nice find of a generic solution.
Of cource you will see 2 pocesses in the processlist.
Does there appear any decription for the service?

Regards
Hans-Peter

Locked