mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2024-12-22 19:49:25 +00:00
Adding systemd service and timer for prober
This commit is contained in:
parent
0804c4f055
commit
899ffd0830
3 changed files with 40 additions and 0 deletions
12
README.md
12
README.md
|
@ -14,4 +14,16 @@ For initial server setup:
|
|||
4. Build the binary with `make build`.
|
||||
5. Run the service with `./bin/xmr-nodes-static-linux-<YOUR_CPU_ARCH> serve`.
|
||||
|
||||
To create admin user (for creating prober API key from Web-UI, execute `./bin/xmr-nodes-static-linux-<YOUR_CPU_ARCH> admin create`).
|
||||
|
||||
Systemd example: [./tools/resources/init/xmr-nodes-server.service](./tools/resources/init/xmr-nodes-server.service).
|
||||
|
||||
For initial prober setup:
|
||||
|
||||
1. Create API key for prober
|
||||
2. Copy `.env.example` to `.env` and edit it to match with prober environment.
|
||||
3. Build the binary with `make build`.
|
||||
4. Run the service with `./bin/xmr-nodes-static-linux-<YOUR_CPU_ARCH> prober`.
|
||||
|
||||
Systemd example: [xmr-nodes-prober.service](./tools/resources/init/xmr-nodes-prober.service) and [xmr-nodes-prober.timer](./tools/resources/init/xmr-nodes-prober.timer).
|
||||
|
||||
|
|
12
tools/resources/init/xmr-nodes-prober.service
Normal file
12
tools/resources/init/xmr-nodes-prober.service
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=xmr-node prober service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ditatompel
|
||||
WorkingDirectory=/path/to/project/dir
|
||||
ExecStart=/path/to/project/dir/bin/xmr-nodes-static-linux-arm64 probe
|
||||
TimeoutSec=90
|
||||
|
||||
# vim: filetype=systemd
|
16
tools/resources/init/xmr-nodes-prober.timer
Normal file
16
tools/resources/init/xmr-nodes-prober.timer
Normal file
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=Schedule fetch monero node info every 30 seconds
|
||||
|
||||
[Timer]
|
||||
Persistent=true
|
||||
#Run 120 seconds after boot for the first time
|
||||
OnBootSec=120
|
||||
#Run every 30 seconds thereafter
|
||||
OnCalendar=*-*-* *:*:00,30
|
||||
#File describing job to execute
|
||||
Unit=xmr-nodes-prober.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
||||
# vim: filetype=systemd
|
Loading…
Reference in a new issue