After some frustrating attempts to get a usable control script for my chrooted OpenBSD system I hacked together some mods for the default torctl file (that tor.sh points at). In the end I did not alter (or use for that matter) tor.sh because it doesn't play nice with torctl on my system. Here is my file and the changes I made are commented below. You can also set your /etc/rc.local to execute 'torctl start' so it will load on boot. Also, if you execute this torctl file and have duplicate settings in your torrc you stand a good chance of seeing duplicate log messages which can be annoying. My suggestion is to EITHER remove the $TORARGS part of the START line (see below) and move all necessary settings into your torrc OR remove your log directive from your torrc. For the sack of legibility I remove some comments.
Any improvements are welcome.
{{{
#!/bin/sh
# Name of the executable
EXEC=tor
#added this:
CHROOT="/var/tor" # the path to the chroot directory
#changed this... this is within the chroot when called:
TORBIN="/bin/$EXEC" # the path to your binary, including options if necessary
#changed this... this is within the chroot when called:
TORCONF="/etc/tor/torrc" # the path to the configuration file
#changed this... this is within the chroot when called:
PIDFILE="/var/lib/tor/tor.pid" # the path to your PID file
#changed this... this is within the chroot when called:
LOGFILE="/var/log/notices.log" # The path to the log file
#changed this... this is within the chroot when called:
TORDATA="/var/lib/tor" # The path to the datadirectory