Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pharo (VM) not able to run as a (headless) Windows service anymore #2352

Closed
astares opened this issue Jan 27, 2019 · 4 comments
Closed

Pharo (VM) not able to run as a (headless) Windows service anymore #2352

astares opened this issue Jan 27, 2019 · 4 comments

Comments

@astares
Copy link
Member

astares commented Jan 27, 2019

The VM for Squeak (and initial Pharo) was able to run headless as a Windows Service.
This is not only useful but often necessary for deploying Pharo (web) services on Windows
platforms. Running as a service allows for easy maintenance (start, stop, backup services,
remote administration, ...).

Usually one would see the Services running on a machine in the Windows Service manager:

Unfortunately with current Pharo this deployment option. The "-service" option on the command
line of the Pharo VM as described in

http://wiki.squeak.org/squeak/105

seems lost. Maybe also the others like "-log", "-memory" and "-browserWindow"

Scenario to reproduce:

  1. Download latest Pharo Windows VM version
    ===========================================
    1.1. Download http://files.pharo.org/get-files/70/pharo-win-latest.zip
    1.2. Extract contents to c:\myservice

  2. Download latest Pharo image version
    ======================================
    2.1. Download http://files.pharo.org/get-files/70/pharo.zip
    2.2. Extract contents to c:\myservice
    at the time of this writing this was
    - Pharo7.0-32bit-52a28a8.image
    - Pharo7.0-32bit-52a28a8.sources
    - Pharo7.0-32bit-52a28a8.changes

  3. Start Pharo image the first time
    ===================================
    3.1. Drag the "Pharo7.0-32bit-52a28a8.image" to the VM executable "Pharo.exe" to start Pharo
    3.2. Open a Playground and enter

    (ZnServer startDefaultOn: 9091)
    onRequestRespond: [:request | ZnResponse ok: (ZnEntity text: Time now asString )]

3.3. Point your browser to http://localhost:9091/ to verify that the server is running.
Hit refresh in the brower to see the time change.

3.4. Click on "Save and Quit" in the world menu to save and close the image

  1. Start Pharo image a second time
    ===================================
    4.1. Drag the "Pharo7.0-32bit-52a28a8.image" to the VM executable "Pharo.exe" to start Pharo
    4.2. Point your browser to http://localhost:9091/ to verify that the server is running.
    Hit refresh in the brower to see the time change.
    4.3. Close the image using "Quit" from the world menu

This step is just to verify that the image starts/runs the webserver when it is started.

  1. Try to install as a Windows service
    ======================================
    5.1. On Windows click "Start" and enter cmd.exe to open the Windows DOS Console
    5.2. Change the directory using "cd c:\myservice"
    5.3. Run

       Pharo.exe -service "PharoService" c:\myservice\Pharo7.0-32bit-52a28a8.image
    

    on the command line. This brings you into an: "Command line handler failed 1"
    error.

I guess this is due to the restructuring of Pharo command line handling that this
parameter is not passed to the VM.

But also the command line with -headless

    Pharo.exe -headless -service "PharoService" c:\myservice\Pharo7.0-32bit-52a28a8.image

does not work and install Pharo in the Windows Service manager (services.msc).

Just to confirm that it was once working in Squeak:

One can download and take the old Squeak Swiki Server and run it with the "-service" option
easily: http://wiki.squeak.org/swiki/uploads/10/Winterlong.zip without any problem as Windows service.

@astares
Copy link
Member Author

astares commented Jan 27, 2019

@stale
Copy link

stale bot commented Jul 26, 2019

To limit bug bankruptcy (see https://www.joelonsoftware.com/2012/07/09/software-inventory/) this issue has been automatically marked as stale because it has not had any activity in 6 months. It will be closed in 1 month if no further activity occurs. If this issue remains important to you, please comment to reactivate the issue. Thank you for your contributions.

Joel on Software
Imagine, for a moment, that you came upon a bread factory for the first time. At first it just looks like a jumble of incomprehensible machinery with a few people buzzing around. As your eyes adjus…

@stale stale bot added the stale label Jul 26, 2019
@astares
Copy link
Member Author

astares commented Jul 27, 2019

Still necessary and unsolved

@guillep
Copy link
Member

guillep commented Mar 27, 2020

I've moved this issue to https://github.com/pharo-project/opensmalltalk-vm

Thanks!

GitHub
This is the VM used by Pharo. Contribute to pharo-project/opensmalltalk-vm development by creating an account on GitHub.

@guillep guillep closed this as completed Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants