-
Notifications
You must be signed in to change notification settings - Fork 89
/
service.sh
77 lines (60 loc) · 1.27 KB
/
service.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env sh
NODE_DIR=${NODE_DIR:-$HOME/node}
BIN_DIR=$(go env GOPATH)/bin
USER=$(whoami)
VALIDATOR_ADDRESS='${VALIDATOR_ADDRESS}'
cat > metadata <<EOF
VALIDATOR_ADDRESS=
EOF
cat > bor.service <<EOF
[Unit]
Description=bor
StartLimitIntervalSec=500
StartLimitBurst=5
[Service]
Restart=on-failure
RestartSec=5s
WorkingDirectory=$NODE_DIR
EnvironmentFile=/etc/matic/metadata
ExecStartPre=/bin/chmod +x $NODE_DIR/bor/start.sh
ExecStart=/bin/bash $NODE_DIR/bor/start.sh $VALIDATOR_ADDRESS
Type=simple
User=$USER
KillSignal=SIGINT
TimeoutStopSec=120
[Install]
WantedBy=multi-user.target
EOF
cat > heimdalld.service <<EOF
[Unit]
Description=heimdalld
[Service]
WorkingDirectory=$NODE_DIR
ExecStart=$BIN_DIR/heimdalld start
Type=simple
User=$USER
[Install]
WantedBy=multi-user.target
EOF
cat > heimdalld-rest-server.service <<EOF
[Unit]
Description=heimdalld-rest-server
[Service]
WorkingDirectory=$NODE_DIR
ExecStart=$BIN_DIR/heimdalld rest-server
Type=simple
User=$USER
[Install]
WantedBy=multi-user.target
EOF
cat > heimdalld-bridge.service <<EOF
[Unit]
Description=heimdalld-bridge
[Service]
WorkingDirectory=$NODE_DIR
ExecStart=$BIN_DIR/bridge start --all
Type=simple
User=$USER
[Install]
WantedBy=multi-user.target
EOF