Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Added notes to running validator documentation to ensure that 'exec' …
Browse files Browse the repository at this point in the history
…is used from scripts when starting the validator to prevent logrotate signals from killing the validator. (#18234)

(cherry picked from commit c045f1d)
  • Loading branch information
bji authored and mergify-bot committed Jun 25, 2021
1 parent 41179b1 commit 2a0d759
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docs/src/running-validator/validator-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,13 @@ ExecStart=/home/sol/bin/validator.sh
WantedBy=multi-user.target
```

Now create `/home/sol/bin/validator.sh` to include the desired `solana-validator`
command-line. Ensure that running `/home/sol/bin/validator.sh` manually starts
Now create `/home/sol/bin/validator.sh` to include the desired
`solana-validator` command-line. Ensure that the 'exec' command is used to
start the validator process (i.e. "exec solana-validator ..."). This is
important because without it, logrotate will end up killing the validator
every time the logs are rotated.

Ensure that running `/home/sol/bin/validator.sh` manually starts
the validator as expected. Don't forget to mark it executable with `chmod +x /home/sol/bin/validator.sh`

Start the service with:
Expand Down Expand Up @@ -416,6 +421,12 @@ sudo cp logrotate.sol /etc/logrotate.d/sol
systemctl restart logrotate.service
```

As mentioned earlier, be sure that if you use logrotate, any script you create
which starts the solana validator process uses "exec" to do so (example: "exec
solana-validator ..."); otherwise, when logrotate sends its signal to the
validator, the enclosing script will die and take the validator process with
it.

### Disable port checks to speed up restarts

Once your validator is operating normally, you can reduce the time it takes to
Expand Down

0 comments on commit 2a0d759

Please sign in to comment.