Skip to content

Commit cef9caf

Browse files
committed
[+] Add service wrappers to the package, closes #2
1 parent d2fb085 commit cef9caf

File tree

6 files changed

+36
-99
lines changed

6 files changed

+36
-99
lines changed

make.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ SET MD=patroni-win-x64
33
SET ETCD_REF=https://github.com/etcd-io/etcd/releases/download/v3.3.22/etcd-v3.3.22-windows-amd64.zip
44
SET PATRONI_REF=https://github.com/zalando/patroni/archive/v1.6.5.zip
55
SET MICRO_REF=https://github.com/zyedidia/micro/releases/download/v2.0.6/micro-2.0.6-win64.zip
6+
SET WINSW_REF=https://github.com/winsw/winsw/releases/download/v2.9.0/WinSW.NET461.exe
67

78
@ECHO --- Start bootstrapping ---
89

@@ -28,6 +29,13 @@ powershell -Command "Expand-Archive '%TEMP%\micro.zip' '%CD%'"
2829
MOVE micro-* %MD%\micro
2930
@ECHO --- MICRO downloaded ---
3031

32+
@ECHO --- Download WINSW ---
33+
MKDIR %MD%\service
34+
curl %MICRO_REF% --location --output %MD%\service\patroni_service.exe
35+
COPY %MD%\service\patroni_service.exe %MD%\service\etcd_service.exe /B
36+
COPY %MD%\service\patroni_service.exe %MD%\service\vip_service.exe /B
37+
@ECHO --- WINSW downloaded ---
38+
3139
@ECHO --- Download PATRONI ---
3240
curl %PATRONI_REF% --location --output %TEMP%\patroni.zip
3341
powershell -Command "Expand-Archive '%TEMP%\patroni.zip' '%CD%'"

src/etcd_service.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<service>
2+
<id>etcd</id>
3+
<name>etcd</name>
4+
<description>Distributed reliable key-value store</description>
5+
<executable>%BASE%\etcd\ectd.exe</executable>
6+
<arguments>--config-file=%BASE%\etcd.conf</arguments>
7+
</service>
File renamed without changes.

src/patroni_service.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<service>
2+
<id>patroni</id>
3+
<name>Patroni HA Windows Service</name>
4+
<description>Patroni high-availability solution using Python and etcd</description>
5+
<executable>C:\Users\pasha\AppData\Local\Programs\Python\Python38\python.exe</executable>
6+
<arguments>%BASE%\patroni\patroni.py %BASE%\postgres-win0.yml</arguments>
7+
<stopparentprocessfirst>true</stopparentprocessfirst>
8+
<log mode="roll"></log>
9+
<logpath>%BASE%\log</logpath>
10+
<serviceaccount>
11+
<user>postgres</username>
12+
<password>12345</password>
13+
</serviceaccount>
14+
</service>

src/postgres-win1.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

src/vip_service.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<service>
2+
<id>vip-manager</id>
3+
<name>vip-manager</name>
4+
<description>Manager for a virtual IP based on state kept in etcd or Consul </description>
5+
<executable>%BASE%\vip-manager\vip-manager.exe</executable>
6+
<arguments>-config %BASE%\vip-manager.yml</arguments>
7+
</service>

0 commit comments

Comments
 (0)