aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Appelbaum <jacob@appelbaum.net>2011-08-26 19:21:51 +0200
committerJacob Appelbaum <jacob@appelbaum.net>2011-08-26 19:21:51 +0200
commitaf8a6c3a1bff412c2ffca3576daa0d98260c1efa (patch)
treea626d2a672b9bfd2f09fa1fb25942e4ba8d40df5
parent94f4b6469db5364aea2c6415fa2c93c5c6bad605 (diff)
downloadtorouter-af8a6c3a1bff412c2ffca3576daa0d98260c1efa.tar.gz
torouter-af8a6c3a1bff412c2ffca3576daa0d98260c1efa.zip
start arm at boot via cron in a shared screen for torouter
-rw-r--r--packages/torouter-prep/configs/tor-arm-crontab3
-rw-r--r--packages/torouter-prep/src/torouter_config.sh14
2 files changed, 13 insertions, 4 deletions
diff --git a/packages/torouter-prep/configs/tor-arm-crontab b/packages/torouter-prep/configs/tor-arm-crontab
new file mode 100644
index 0000000..b662b22
--- /dev/null
+++ b/packages/torouter-prep/configs/tor-arm-crontab
@@ -0,0 +1,3 @@
+# Now anyone using the torouter can attach to a long term screen with arm
+# This will run at boot time and it should run forever
+@reboot screen -d -m -S tor-arm /usr/bin/arm
diff --git a/packages/torouter-prep/src/torouter_config.sh b/packages/torouter-prep/src/torouter_config.sh
index c2a8527..04a8206 100644
--- a/packages/torouter-prep/src/torouter_config.sh
+++ b/packages/torouter-prep/src/torouter_config.sh
@@ -11,9 +11,7 @@ export config_dir="/usr/share/torouter-prep/example-configs/"
# Add a user to administrate the Torouter later
export ADMINUSER="torouter"
export ADMINGROUP="torouter"
-
-addgroup $ADMINGROUP
-useradd -g $ADMINGROUP -s /bin/bash $ADMINUSER
+export TORADMINGROUP="debian-tor"
# Install the Tor repo key
# gpg --keyserver keys.gnupg.net --recv 886DDD89
@@ -145,7 +143,6 @@ apt-get -y clean
# Fixup apt if something goes wrong
apt-get install -f
-
## Disable ipv6 support for now
cp $config_dir/modprobe.d-blacklist.conf /etc/modprobe.d/blacklist.conf
# We don't need this if the ipv6 module is not loaded
@@ -166,8 +163,17 @@ apt-get -y install unbound
/etc/init.d/tor restart
/etc/init.d/ttdnsd restart
+addgroup $ADMINGROUP
+useradd -g $ADMINGROUP -G $TORADMINGROUP -s /bin/bash $ADMINUSER
+
+##
+## Add arm startup trick with cron for shared screen
+##
+crontab -u $ADMINUSER $config_dir/tor-arm-crontab
+
##
## Touch a stamp to show that we're now a Torouter
##
echo "torouter $VERSION" > /etc/torouter
+echo "You should reboot now to ensure that everything works as expected"