A quick post on a simple way to keep your Arionum nodes and Arionum masternodes up to date and secure.

In Ubuntu, there are config files you can configure to automatically run security updates on software running on your server. We are going to do something a bit easier.

All you need to do is setup a cron job (automated script) to run aronode mainnet update AND aronode mainnet upgrade. I’d run update twice a day and run upgrade once per day.

Running update just updates the aronode script from github and the arionum node code from github as well. This should not cause any downtime unless there is a release that causes breaking changes which may occur during a fork.

Running upgrade runs the “apt-get” linux commands to update your local software repos AND then download updates AND install them. Usually this will cause very minimal downtime while it restarts all the updated services but if there is an issue your node may stop so use something like UptimeRobot to monitor your node address.

To automate updates AND upgrades. do this on your server:

# login as root
$ sudo su -
$ sudo crontab -e; 
# add the following TWO lines
10 03 * * * /bin/bash /usr/local/bin/aronode mainnet update > /var/log/aronode_cron_update.log
30 03 * * * /bin/bash /usr/local/bin/aronode mainnet upgrade > /var/log/aronode_cron_upgrade.log
# then type CTRL+X then Y then ENTER
# screen should say "crontab: installing new crontab"
$ crontab -l;
# this just shows you the output of your cron job does it look correct?

The first line runs the command once per day at 3:10AM.
The second line runs once per day at 3:30AM.

You can check your /var/log/aronode_cron_update.log and /var/log/aronode_cron_upgrade.log to see if they ran ok. Also, /var/log/syslog will log the start of the cron task with a timestamp so you can see if it actually was called by the cron service or not.

NOTE: Some upgrades like kernel vulnerabilities may require reboots. You could add a cron to reboot your server once per week. So if you dont reboot automatically then you will need to reboot manually every so often. Arionum runs as a website so rebooting will auto start everything you need (nginx, mysql, php-fpm, etc.).

# Example: to autoreboot once per week
30 4 * * 5 /sbin/shutdown -r +5

There is a bug I noticed about the cron not being able to find the service command (probably needs the full path). I added the bug to github so it should be fixed when i get to it. But services should still upgrade fine.