BBasic als Service starten
BBasic hat eine Kopie von WINSW mit installiert. Damit kann jedes Programm als Service gestartet werden.
Das Programm heißt BBASICRUNSERVICE und ist im Programmnet-Verzeichnis
- Take BBASICRUNSERVICE.exe from the distribution, and rename the .exe to your taste (such as myapp.exe).
- Write myapp.xml (see the XML config file specification and samples for more details).
- Place those two files side by side, because that's how WinSW discovers its co-related configuration.
- Run
myapp.exe install [options]to install the service. - Run
myapp.exe startto start the service.
You write the configuration file that defines your service. The example below is a primitive example being used in the Jenkins project:
<service>
<id>jenkinsid>
<name>Jenkinsname>
<description>This service runs Jenkins continuous integration system.description>
<env name="JENKINS_HOME" value="%BASE%"/>
<executable>javaexecutable>
<arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080arguments>
<log mode="roll">log>
service>
The full specification of the configuration file is available here. You can find more samples here.
WinSW is being managed by the XML configuration file.
Your renamed WinSW.exe binary also accepts the following commands:
| Command | Description |
|---|---|
| install | Installs the service. |
| uninstall | Uninstalls the service. |
| start | Starts the service. |
| stop | Stops the service. |
| restart | Stops and then starts the service. |
| status | Checks the status of the service. |
| refresh | Refreshes the service properties without reinstallation. |
| customize | Customizes the wrapper executable. |
| dev | Experimental commands. |
Experimental commands:
| Command | Description |
|---|---|
| dev ps | Draws the process tree associated with the service. |
| dev kill | Terminates the service if it has stopped responding. |
| dev list | Lists services managed by the current executable. |
Most commands require Administrator privileges to execute. WinSW will prompt for UAC in non-elevated sessions.
Das Programm basiert auf GitHub - winsw/winsw: A wrapper executable that can run any executable as a Windows service