Added notes to running validator documentation to ensure that 'exec' is used from scripts when starting the validator to prevent logrotate signals from killing the validator. (#18234)

This commit is contained in:
bji 2021-06-25 13:02:26 -07:00 committed by GitHub
parent e06376664b
commit c045f1dfb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -358,8 +358,13 @@ ExecStart=/home/sol/bin/validator.sh
WantedBy=multi-user.target WantedBy=multi-user.target
``` ```
Now create `/home/sol/bin/validator.sh` to include the desired `solana-validator` Now create `/home/sol/bin/validator.sh` to include the desired
command-line. Ensure that running `/home/sol/bin/validator.sh` manually starts `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` the validator as expected. Don't forget to mark it executable with `chmod +x /home/sol/bin/validator.sh`
Start the service with: Start the service with:
@ -416,6 +421,12 @@ sudo cp logrotate.sol /etc/logrotate.d/sol
systemctl restart logrotate.service 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 ### Disable port checks to speed up restarts
Once your validator is operating normally, you can reduce the time it takes to Once your validator is operating normally, you can reduce the time it takes to