WinSW: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
(21 intermediate revisions by the same user not shown)
Line 4: Line 4:
   ├─ chorke-academia-daemon.xml
   ├─ chorke-academia-daemon.xml
   ├─ chorke-academia-daemon.jar
   ├─ chorke-academia-daemon.jar
   ├─ service-uninstall.bat
   ├─ uninstall.bat
   ├─ service-install.bat
   ├─ install.bat
   ├─ README.md
   ├─ README.md
   ├─ start.bat
   ├─ start.bat
Line 21: Line 21:


     <env name="CHORKE_LOG_FILE" value="chorke-academia-daemon"/>
     <env name="CHORKE_LOG_FILE" value="chorke-academia-daemon"/>
    <env name="CHORKE_LOG_FILE_ENABLED" value="true"/>
     <env name="CHORKE_ACADEMIA_HOME" value="%BASE%"/>
     <env name="CHORKE_ACADEMIA_HOME" value="%BASE%"/>
     <env name="CHORKE_LOG_DIR" value="%BASE%\logs"/>
     <env name="CHORKE_LOG_DIR" value="%BASE%\logs"/>
    <env name="CHORKE_LOG_MAX_HISTORY" value="90"/>
    <env name="CHORKE_LOG_MAX_SIZE"  value="3GB"/>
    <env name="CHORKE_LOG_LEVEL"  value="INFO"/>


     <executable>java</executable>
     <executable>java</executable>
     <arguments>-Xrs -Xmx256m -jar "%CHORKE_ACADEMIA_HOME%\chorke-academia-daemon.jar" --server.port=1983</arguments>
     <arguments>-Xrs -Xmx256m -jar "%CHORKE_ACADEMIA_HOME%\chorke-academia-daemon.jar" --server.port=1983</arguments>


     <logpath>%CHORKE_LOG_DIR%\logs</logpath>
     <logpath>%CHORKE_LOG_DIR%</logpath>
     <log mode="roll-by-time">
     <log mode="none"/>
        <pattern>yyyyMMdd</pattern>
    </log>
</service>
</service>
</source>
</source>
==Spring Config==
<source lang="properties">
logging.file.name=${CHORKE_LOG_FILE:chorke-academia-daemon}
logging.file.max-history=${CHORKE_LOG_MAX_HISTORY:90}
logging.file.max-size=${CHORKE_LOG_MAX_SIZE:3GB}
logging.level.root=${CHORKE_LOG_LEVEL:INFO}
logging.file.path=${CHORKE_LOG_DIR:./logs}
chorke.log.file.enabled=${CHORKE_LOG_FILE_ENABLED:false}
chorke.log.daily-log-dir=${CHORKE_LOG_DIR:./logs}
</source>
==Service Logs==
chorke-academia-daemon.log            » '''today'''
chorke-academia-daemon.wrapper.log    » '''truncated'''
chorke-academia-daemon.yyyy-MM-dd.log » '''past date'''


==Batch Scripts==
==Batch Scripts==
Line 38: Line 57:
| valign="top" |
| valign="top" |
<source lang="bat">
<source lang="bat">
chorke-academia-daemon.exe uninstall
chorke-academia-daemon.exe install
chorke-academia-daemon.exe install
chorke-academia-daemon.exe start
</source>
</source>


| valign="top" |
| valign="top" |
<source lang="bat">
<source lang="bat">
chorke-academia-daemon.exe start
chorke-academia-daemon.exe stop
chorke-academia-daemon.exe stop
chorke-academia-daemon.exe uninstall
</source>
</source>


|-
|-
| colspan="3" |
| colspan="2" |
----
----
|-
|-
Line 66: Line 85:
</source>
</source>


|-
| valign="top" |
'''Install Service'''
| valign="top" |
'''Uninstall Service'''
|-
| colspan="2" |
----
|-
| valign="top" |
<source lang="bat">
chorke-academia-daemon.exe install
chorke-academia-daemon.exe start
</source>
| valign="top" |
<source lang="bat">
chorke-academia-daemon.exe stop
chorke-academia-daemon.exe uninstall
</source>
|-
| valign="top" |
'''Start Service'''
| valign="top" |
'''Stop Service'''
|-
| colspan="2" |
----
|-
| valign="top" |
<source lang="bat">
chorke-academia-daemon.exe start
</source>
| valign="top" |
<source lang="bat">
chorke-academia-daemon.exe stop
</source>
|-
| colspan="2" |
----
|-
| valign="top" |
<source lang="bash">
timeout 60 telnet localhost 1983 \
;printf '\n'
</source>
| valign="top" |
<source lang="bash">
nc -w 60 localhost 1983 \
;printf '\n'
</source>
|}
|}


Line 71: Line 145:
{|
{|
| valign="top" |
| valign="top" |
* [https://github.com/winsw/winsw/blob/v3/docs/self-restarting-service.md WinSW » Self-restarting Windows services]
* [https://github.com/winsw/winsw/blob/v3/docs/logging-and-error-reporting.md WinSW » Logging and error reporting]
* [https://github.com/winsw/winsw/blob/v3/docs/logging-and-error-reporting.md WinSW » Logging and error reporting]
* [https://github.com/winsw/winsw WinSW » Windows Service Wrapper]
* [https://github.com/winsw/winsw WinSW » Windows Service Wrapper]
* [https://github.com/winsw/winsw/blob/v3/docs/deferred-file-operations.md WinSW » Deferred file operations]
* [https://github.com/winsw/winsw/blob/v3/docs/deferred-file-operations.md WinSW » Deferred file operations]
* [https://github.com/winsw/winsw/blob/v3/docs/xml-config-file.md WinSW » XML Configuration file]
* [https://github.com/winsw/winsw/blob/v3/docs/xml-config-file.md WinSW » XML Configuration file]
* [https://github.com/jenkinsci/winsw-maven-packaging WinSW » Maven Packaging]
* [https://github.com/winsw/winsw/blob/v3/docs/cli-commands.md WinSW » CLI commands]
* [https://github.com/winsw/winsw/blob/v3/docs/cli-commands.md WinSW » CLI commands]
* [https://github.com/winsw/winsw/blob/v3/docs/migrate-to-3-x.md WinSW » Migrate to 3.x]
* [https://github.com/winsw/winsw/blob/v3/docs/migrate-to-3-x.md WinSW » Migrate to 3.x]
* [https://github.com/winsw/winsw/blob/v3/README.md WinSW » Get started]
* [https://github.com/winsw/winsw/blob/v3/README.md WinSW » Get started]
* [[NSSM]]
* [https://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/ WinSW » Binary]
* [[Java]]
* [https://www.nuget.org/packages/WinSW/ WinSW » NuGet]


| valign="top" |
| valign="top" |
* [https://yajsw.sourceforge.io/ Yet Another Java Service Wrapper (<code>yajsw</code>)]
* [https://yajsw.sourceforge.io/ YAJSW » Yet Another Java Service Wrapper]
* [https://github.com/winsw/winsw/blob/v3/docs/self-restarting-service.md WinSW » Self-restarting Windows services]
* [https://github.com/minio/minio-service/tree/master/windows Running MinIO as a service on Windows]
* [https://github.com/minio/minio-service/tree/master/windows Running MinIO as a service on Windows]
* [[OpenVPN]]


| valign="top" |
| valign="top" |
Line 94: Line 168:
|-
|-
| valign="top" |
| valign="top" |
* [https://infocenter.informationbuilders.com/wf80/index.jsp?topic=%2Fpubdocs%2Freporting%2FUsingFunctions%2Fsource%2Ftopic143.htm Year and Week Number From a Date-Time]
* [[Spring Cloud OpenFeign]]
* [[OpenVPN]]
* [[NSSM]]
* [[Flask]]
* [[Java]]


| valign="top" |
| valign="top" |

Latest revision as of 00:32, 13 February 2024

%CHORKE_ACADEMIA_HOME%\
  ├─ chorke-academia-daemon.copies
  ├─ chorke-academia-daemon.exe
  ├─ chorke-academia-daemon.xml
  ├─ chorke-academia-daemon.jar
  ├─ uninstall.bat
  ├─ install.bat
  ├─ README.md
  ├─ start.bat
  └─ stop.bat

Service Config

<service>
    <id>chorke_academia_service</id>
    <name>Chorke Academia Service</name>
    <description>Chorke Academia Service. Developed by Chorke Inc.</description>

    <env name="JAVA_HOME" value="C:\Program Files\Java\jdk-17.0.6"/>
    <env name="Path" value="%JAVA_HOME%\bin;%Path%"/>

    <env name="CHORKE_LOG_FILE" value="chorke-academia-daemon"/>
    <env name="CHORKE_LOG_FILE_ENABLED" value="true"/>
    <env name="CHORKE_ACADEMIA_HOME" value="%BASE%"/>
    <env name="CHORKE_LOG_DIR" value="%BASE%\logs"/>
    <env name="CHORKE_LOG_MAX_HISTORY" value="90"/>
    <env name="CHORKE_LOG_MAX_SIZE"  value="3GB"/>
    <env name="CHORKE_LOG_LEVEL"   value="INFO"/>

    <executable>java</executable>
    <arguments>-Xrs -Xmx256m -jar "%CHORKE_ACADEMIA_HOME%\chorke-academia-daemon.jar" --server.port=1983</arguments>

    <logpath>%CHORKE_LOG_DIR%</logpath>
    <log mode="none"/>
</service>

Spring Config

logging.file.name=${CHORKE_LOG_FILE:chorke-academia-daemon}
logging.file.max-history=${CHORKE_LOG_MAX_HISTORY:90}
logging.file.max-size=${CHORKE_LOG_MAX_SIZE:3GB}
logging.level.root=${CHORKE_LOG_LEVEL:INFO}
logging.file.path=${CHORKE_LOG_DIR:./logs}

chorke.log.file.enabled=${CHORKE_LOG_FILE_ENABLED:false}
chorke.log.daily-log-dir=${CHORKE_LOG_DIR:./logs}

Service Logs

chorke-academia-daemon.log            » today
chorke-academia-daemon.wrapper.log    » truncated
chorke-academia-daemon.yyyy-MM-dd.log » past date

Batch Scripts

chorke-academia-daemon.exe uninstall
chorke-academia-daemon.exe install
chorke-academia-daemon.exe start
chorke-academia-daemon.exe stop

chorke-academia-daemon.exe refresh
chorke-academia-daemon.exe restart
chorke-academia-daemon.exe status
chorke-academia-daemon.exe dev kill
chorke-academia-daemon.exe dev list
chorke-academia-daemon.exe dev ps

Install Service

Uninstall Service


chorke-academia-daemon.exe install
chorke-academia-daemon.exe start
chorke-academia-daemon.exe stop
chorke-academia-daemon.exe uninstall

Start Service

Stop Service


chorke-academia-daemon.exe start
chorke-academia-daemon.exe stop

timeout 60 telnet localhost 1983 \
;printf '\n'
nc -w 60 localhost 1983 \
;printf '\n'

References