-
Notifications
You must be signed in to change notification settings - Fork 342
(GH-489) Install-ChocolateyService feature #506
base: master
Are you sure you want to change the base?
Conversation
… to src/helpers/chocolateyInstaller.psm1
… according instructions CONTRIBUTING document
…o helpers directory
…tions added to psm file
…parameters are passed
…of 5seconds if it is not able to start the first time to avoid incorrect error
…tart. If optional port is specified then a check is done to see whether port is available. Creation of service mimiced by installing ping localhost bat file using NSSM as service. Test directory cleaned after finishing test
…cceptable by Chocolatey
I misunderstood regarding the documentation. It has been added again. |
Remove-Service has been renamed to Uninstall-ChocolateyService |
Tests have been run again and everything still works.
|
At the moment the createServiceCommand needs to be a valid command. I have tried to add more options to this, but the destinction between the services I would like to create using the Install-ChocolateyService is too large, e.g. apacheds (NSSM + two options), dcm4chee (NSSM + 1 option), tomcatzip (native service.bat) and postgresqlzip (native service.bat). Should I add more examples regarding the creation of a service? |
@030 Some real live examples would be good. |
…services using Install-ChocolateyService
@ferventcoder Real live examples have been added |
Could you specify the label? What does 0-triaging mean in this case? Does it mean that this feature will be dropped or implemented soon? |
In this case, triaging is referring to checking the pull request, for suitability, problems, additional suggestions, etc. This is the first pass at getting the pull request pulled into the main code base of Chocolatey. This is a good thing :-) You will hear from Rob if there are any changes that need to be made. |
@gep13 Thank you for the explanation |
If no port is specified the service will not be started as TRUE will be returned |
…fficient if port is unavailable
…d anymore. Fixed identity as well.
I'm still confused what kind of service this is installing. Is this not a Windows Service (most of those do NOT require ports)? |
The port is optional. E.g. PostgreSQL, DCM4CHEE, Tomcat, JBoss require that ports are available. The script installs a Windows service indeed. |
Should |
No need, I was trying to understand how port would keep the service from being started if no port is specified when it is optional. |
Feature created which is able to create a Windows service by passing packageName, serviceName, createServiceCommand and availablePort (optional).
If the service already exist, this will be stopped and removed before creating the Service.
If the availablePort parameter is passed, a check will be executed whether the port is available or not. If the port is in LISTENING state, a ChocolateyError will be thrown and the installation exits. If no port parameter is passed, no check will be done.
If the createServiceCommand parameter cannot be executed an error will be thrown and the installer exits.
Some code had to be moved to separate functions to avoid code duplication.
10 tests were run. A bat file containing
ping localhost
was created and run using NSSM to mimic installation and running of a service.