Skip to content

Commit

Permalink
Merge pull request #12 from komachi/master
Browse files Browse the repository at this point in the history
Use monit.
  • Loading branch information
micahflee committed May 13, 2015
2 parents a09ee5a + 7d37fda commit b70ce74
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tor-relay-bootstrap does this:
* Configures sane default firewall rules
* Configures automatic updates
* Installs tlsdate to ensure time is synced
* Installs monit and activate config to auto-restart all services
* Helps harden the ssh server
* Gives instructions on what the sysadmin needs to manually do at the end

Expand Down
5 changes: 5 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ else
apt-get install -y tlsdate
fi
# install monit
apt-get install -y monit
cp $PWD/etc/monit/conf.d/tor-relay.conf /etc/monit/conf.d/tor-relay.conf
service monit restart
# configure sshd
ORIG_USER=$(logname)
if [ -n "$ORIG_USER" ]; then
Expand Down
9 changes: 9 additions & 0 deletions etc/monit/conf.d/tor-relay.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
check process tor with pidfile "/var/run/tor/tor.pid"
start program = "/etc/init.d/tor start"
stop program = "/etc/init.d/tor stop"
check process fail2ban with pidfile "/var/run/fail2ban/fail2ban.pid"
start program = "/etc/init.d/fail2ban start"
stop program = "/etc/init.d/fail2ban stop"
check process tlsdated with pidfile "/var/run/tlsdated.pid"
start program = "/etc/init.d/tlsdated start"
stop program = "/etc/init.d/tlsdated stop"

0 comments on commit b70ce74

Please sign in to comment.