Windows headless and service

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows headless and service

Torsten Bergmann
Running as Windows Service was possible back in Squeak VM days where
Andreas Raab implemented registration into SCM (Service Control Manager).
Code should be in Pharo VM too.

See also http://forum.world.st/headless-CogVM-on-Windows-td4648336.html

Possibly the "-service" may be broken/may not be recognized in Pharo Win VM
anymore, havent checked.

Bye
T.

Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

kuszi
Torsten, thanks.

Ok, I'll test it. Idon't mind I need SRVANY or other solution on win to start it. It is not necessary to provide a well formed service.
I'm stopped at the headless running at all. I'Ll check the headless CogVM. Once it runs headless I'll be able to launch it at machine start.

I'll share my results here.

best regards
Robert


Torsten Bergmann <[hidden email]> ezt írta (időpont: 2016. jan. 31., V, 1:31):
Running as Windows Service was possible back in Squeak VM days where
Andreas Raab implemented registration into SCM (Service Control Manager).
Code should be in Pharo VM too.

See also http://forum.world.st/headless-CogVM-on-Windows-td4648336.html

Possibly the "-service" may be broken/may not be recognized in Pharo Win VM
anymore, havent checked.

Bye
T.

Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

kuszi
Hello!

No luck by far. Information on forums is not enopugh for me (this is definitely my fault, my limited background in the squek/pharo VM world).

I've checked different setups. Even putting CogVM into operation with Pharo is not evident for me.

My trivial test was the -headless option which is listed with windows Pharo but it won't start at all. No process is created. The XULRunner example mentioned is "out of my reach" (and the demo was on Linux, also subsequent comments on the forums stated that Mac/Win versions are not headless.).

Who could check if it works at all? Actually I've invested a week in this small Seaside app, performs beautifully but now it seems that It simply cannot be installed on Windows? How do people use Seaside/Pharo on Windows. Is there someone using it at all? :)
No problem if I'm the first one, anyway.
My goal is to start it automatically in the background (service is not necessary, again, it is enought to be started).
Is it possible that Pharo starts with a widnow (splash) but noone sees it?

Summarizing:
- I'm looking for a solution to start a headless Seaside app on Windows possibly with Pharo image.

thanks for any recommendations.




Robert Kuszinger <[hidden email]> ezt írta (időpont: 2016. jan. 31., V, 8:27):
Torsten, thanks.

Ok, I'll test it. Idon't mind I need SRVANY or other solution on win to start it. It is not necessary to provide a well formed service.
I'm stopped at the headless running at all. I'Ll check the headless CogVM. Once it runs headless I'll be able to launch it at machine start.

I'll share my results here.

best regards
Robert


Torsten Bergmann <[hidden email]> ezt írta (időpont: 2016. jan. 31., V, 1:31):
Running as Windows Service was possible back in Squeak VM days where
Andreas Raab implemented registration into SCM (Service Control Manager).
Code should be in Pharo VM too.

See also http://forum.world.st/headless-CogVM-on-Windows-td4648336.html

Possibly the "-service" may be broken/may not be recognized in Pharo Win VM
anymore, havent checked.

Bye
T.

Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

Ben Coman
On Mon, Feb 1, 2016 at 4:04 PM, Robert Kuszinger <[hidden email]> wrote:

> Who could check if it works at all? Actually I've invested a week in this
> small Seaside app, performs beautifully but now it seems that It simply
> cannot be installed on Windows? How do people use Seaside/Pharo on Windows.
> Is there someone using it at all? :)
> No problem if I'm the first one, anyway.
> My goal is to start it automatically in the background (service is not
> necessary, again, it is enought to be started).
> Is it possible that Pharo starts with a widnow (splash) but noone sees it?
>
> Summarizing:
> - I'm looking for a solution to start a headless Seaside app on Windows
> possibly with Pharo image.
>
> thanks for any recommendations.

Hi Robert,

I haven't had anything to do with headless Pharo, so I'm no use to you
there.  Hopefully someone else can help, but I have personal saying
"If you can't solve the problem, change the problem" -- so just a wild
suggestion for a kludge workaround until you get a better answer - run
virtualbox headless [1] or as a service [2] with Linux inside to run
headless Pharo.  Disclaimer, I've not tried these myself either - just
found them through a search.

[1] https://mkrmr.wordpress.com/2011/05/06/running-a-headless-virtualbox-in-windows/
[2] https://code.google.com/archive/p/virtualboxservice/

HTH, cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

kuszi
Wow!

Nice workaround but cannot help this case.
If I'd have the power for such a thing I'd change the Win server to Linux.
There are too many dependencies in the background which are all Windows related. I cannot add - or better, not allowed to add -  virtualbox nor qemu or other layer to the system. And this small app also uses ODBC to connect SQL server on the same Win machine. But the key issue is that I cannot add any other component but maybe Smalltalk app. Smalltalk is my choice and preference. And actually, the app is done.

Anyway, thanks for the idea :)

Best regards
Robert




Ben Coman <[hidden email]> ezt írta (időpont: 2016. febr. 1., H, 10:29):
On Mon, Feb 1, 2016 at 4:04 PM, Robert Kuszinger <[hidden email]> wrote:
> Who could check if it works at all? Actually I've invested a week in this
> small Seaside app, performs beautifully but now it seems that It simply
> cannot be installed on Windows? How do people use Seaside/Pharo on Windows.
> Is there someone using it at all? :)
> No problem if I'm the first one, anyway.
> My goal is to start it automatically in the background (service is not
> necessary, again, it is enought to be started).
> Is it possible that Pharo starts with a widnow (splash) but noone sees it?
>
> Summarizing:
> - I'm looking for a solution to start a headless Seaside app on Windows
> possibly with Pharo image.
>
> thanks for any recommendations.

Hi Robert,

I haven't had anything to do with headless Pharo, so I'm no use to you
there.  Hopefully someone else can help, but I have personal saying
"If you can't solve the problem, change the problem" -- so just a wild
suggestion for a kludge workaround until you get a better answer - run
virtualbox headless [1] or as a service [2] with Linux inside to run
headless Pharo.  Disclaimer, I've not tried these myself either - just
found them through a search.

[1] https://mkrmr.wordpress.com/2011/05/06/running-a-headless-virtualbox-in-windows/
[2] https://code.google.com/archive/p/virtualboxservice/

HTH, cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

EstebanLM
In reply to this post by kuszi
Hi  Robert, 

First, the option to execute pharo headless is “—headless” (two “-“, not just one). Maybe the help is bad :)
But that will not solve your problem at all, since headless mode is fake and in case of windows it will open anyway a window (in the systray if you are lucky…). 

However, I managed (some years ago, so do not ask for details ;) to run a pharo app as a service using this program: http://rozanski.org.uk/services
(I do not remember how I did it and it would be nice if you can share your experience, so we can have documentation somewhere :P)

Also I googled a bit and according to this: http://stackoverflow.com/questions/3582108/create-windows-service-from-executable, looks like the “microsoft” way of doing it is using a command “sc”. I suppose that command will not work if your program is not prepared for being a service, but you can give it a try (first approach *will* work, anyway :P)

Hope this works… please keep us informed. 
Esteban


On 01 Feb 2016, at 09:04, Robert Kuszinger <[hidden email]> wrote:

Hello!

No luck by far. Information on forums is not enopugh for me (this is definitely my fault, my limited background in the squek/pharo VM world).

I've checked different setups. Even putting CogVM into operation with Pharo is not evident for me.

My trivial test was the -headless option which is listed with windows Pharo but it won't start at all. No process is created. The XULRunner example mentioned is "out of my reach" (and the demo was on Linux, also subsequent comments on the forums stated that Mac/Win versions are not headless.).

Who could check if it works at all? Actually I've invested a week in this small Seaside app, performs beautifully but now it seems that It simply cannot be installed on Windows? How do people use Seaside/Pharo on Windows. Is there someone using it at all? :)
No problem if I'm the first one, anyway.
My goal is to start it automatically in the background (service is not necessary, again, it is enought to be started).
Is it possible that Pharo starts with a widnow (splash) but noone sees it?

Summarizing:
- I'm looking for a solution to start a headless Seaside app on Windows possibly with Pharo image.

thanks for any recommendations.




Robert Kuszinger <[hidden email]> ezt írta (időpont: 2016. jan. 31., V, 8:27):
Torsten, thanks.

Ok, I'll test it. Idon't mind I need SRVANY or other solution on win to start it. It is not necessary to provide a well formed service.
I'm stopped at the headless running at all. I'Ll check the headless CogVM. Once it runs headless I'll be able to launch it at machine start.

I'll share my results here.

best regards
Robert


Torsten Bergmann <[hidden email]> ezt írta (időpont: 2016. jan. 31., V, 1:31):
Running as Windows Service was possible back in Squeak VM days where
Andreas Raab implemented registration into SCM (Service Control Manager).
Code should be in Pharo VM too.

See also http://forum.world.st/headless-CogVM-on-Windows-td4648336.html

Possibly the "-service" may be broken/may not be recognized in Pharo Win VM
anymore, havent checked.

Bye
T.


Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

kuszi

Esteban,


thanks, I'll try and keep informed...

regards
Robert



2016-02-01 11:14 GMT+01:00 Esteban Lorenzano <[hidden email]>:
Hi  Robert, 

First, the option to execute pharo headless is “—headless” (two “-“, not just one). Maybe the help is bad :)
But that will not solve your problem at all, since headless mode is fake and in case of windows it will open anyway a window (in the systray if you are lucky…). 

However, I managed (some years ago, so do not ask for details ;) to run a pharo app as a service using this program: http://rozanski.org.uk/services
(I do not remember how I did it and it would be nice if you can share your experience, so we can have documentation somewhere :P)

Also I googled a bit and according to this: http://stackoverflow.com/questions/3582108/create-windows-service-from-executable, looks like the “microsoft” way of doing it is using a command “sc”. I suppose that command will not work if your program is not prepared for being a service, but you can give it a try (first approach *will* work, anyway :P)

Hope this works… please keep us informed. 
Esteban





Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

jan.struz
In reply to this post by kuszi
Hi,
try NSSM - https://nssm.cc/usage

I personally haven't found anything better.
Save The World!
Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

EstebanLM

> On 01 Feb 2016, at 13:19, jan.struz <[hidden email]> wrote:
>
> Hi,
> try NSSM - https://nssm.cc/usage
>
> I personally haven't found anything better.

looks nice! :)

>
>
>
>
> -----
> Save The World!
> --
> View this message in context: http://forum.world.st/Windows-headless-and-service-tp4874988p4875168.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

kuszi
Hello Everyone!

I've tested NSSM successfully with manual service start and reboot/auto start as well.

Details:

Windows Server 2008 R2 64 bit.

  • For the log: Pharo.exe --headless <image_name> does nothing. Executed from windows command line in the directory where Pharo is installed (actually, extracted)
  • NSSM
    • full path to pharo exe
    • working directory is the path where Pharo.exe is put
    • parameter: name of production image pu in the same working dir
    • enable interaction with desktop (haven't tested without itt
    • all other options are default
  • Service appears on service list. Started well manually.
  • Seaside web server with installed app is alive and runs well
  • Service manual stop function works (actually, kills it, no problem, this is a stateless server holding only volatile session data thus no shutdown callback is necessary)

That's all by far.

This seems to be a 100% solution to run Pharo WWW server on Windows as a service. Thanks for the many ideas and support.


Later on I may inform you on the results of real life situations (load, stability, etc).


Best regards
Robert

Esteban Lorenzano <[hidden email]> ezt írta (időpont: 2016. febr. 1., H, 13:46):

> On 01 Feb 2016, at 13:19, jan.struz <[hidden email]> wrote:
>
> Hi,
> try NSSM - https://nssm.cc/usage
>
> I personally haven't found anything better.

Reply | Threaded
Open this post in threaded view
|

Re: Windows headless and service

Ben Coman
Good to hear your success. Thanks for the update.
cheers -ben

On Mon, Feb 8, 2016 at 12:57 AM, Robert Kuszinger <[hidden email]> wrote:

> Hello Everyone!
>
> I've tested NSSM successfully with manual service start and reboot/auto
> start as well.
>
> Details:
>
> Windows Server 2008 R2 64 bit.
>
> For the log: Pharo.exe --headless <image_name> does nothing. Executed from
> windows command line in the directory where Pharo is installed (actually,
> extracted)
> NSSM
>
> full path to pharo exe
> working directory is the path where Pharo.exe is put
> parameter: name of production image pu in the same working dir
> enable interaction with desktop (haven't tested without itt
> all other options are default
>
> Service appears on service list. Started well manually.
> Seaside web server with installed app is alive and runs well
> Service manual stop function works (actually, kills it, no problem, this is
> a stateless server holding only volatile session data thus no shutdown
> callback is necessary)
>
> That's all by far.
>
> This seems to be a 100% solution to run Pharo WWW server on Windows as a
> service. Thanks for the many ideas and support.
>
>
> Later on I may inform you on the results of real life situations (load,
> stability, etc).
>
>
> Best regards
> Robert
>
> Esteban Lorenzano <[hidden email]> ezt írta (időpont: 2016. febr. 1.,
> H, 13:46):
>>
>>
>> > On 01 Feb 2016, at 13:19, jan.struz <[hidden email]> wrote:
>> >
>> > Hi,
>> > try NSSM - https://nssm.cc/usage
>> >
>> > I personally haven't found anything better.
>>
>