Commit d18ec9c1 authored by amnesia's avatar amnesia

WIP: start Tor and Vidalia only once HTP is done.

parent 9408c51f
......@@ -15,7 +15,7 @@
AMNESIA_BASE="gnome"
# Base for the string that will be passed to "lh config --bootappend-live"
AMNESIA_APPEND="quiet splash vga=788 live-media=removable nopersistent noprompt=usb"
AMNESIA_APPEND="quiet splash vga=788 live-media=removable nopersistent noprompt=usb sysv-rc=tor"
# Options passed to isohybrid
# Default: "-entry 4 -type 1c"
......
......@@ -33,6 +33,14 @@ fi
LOG=/var/log/nm-htp.log
HTPDATE_LOG=/var/log/htpdate.log
DONE_FILE=/var/lib/live/htp-done
if [ -e "${DONE_FILE}" ]; then
exit 0
fi
export DISPLAY=':0.0'
exec /bin/su -c /usr/local/bin/amnesia-htp-notify-user amnesia &
declare -a HTP_POOL
HTP_POOL=(
......@@ -116,4 +124,6 @@ echo "htpdate exited with return code ${HTPDATE_RET}" >>$LOG
cleanup_etc_hosts
touch "${DONE_FILE}"
exit ${HTPDATE_RET}
......@@ -12,19 +12,23 @@ fi
PIDFILE=/var/run/tor/tor.pid
# We don't start Tor automatically anymore so *this* is the time when
# it is supposed to start.
if [ -r "${PIDFILE}" ]; then
# A SIGHUP should be enough but there's a bug in Tor. Details:
# * https://bugs.torproject.org/flyspray/index.php?do=details&id=1247
# * https://amnesia.boum.org/bugs/tor_vs_networkmanager/
invoke-rc.d tor restart
# Restart Vidalia because it does not automatically reconnect to the new
# Tor instance. Use kill+start as X-GNOME-AutoRestart does not exist in
# Lenny's Gnome.
if killall vidalia ; then
sleep 2 # give lckdo a chance to release the lockfile
export DISPLAY=':0.0'
exec /bin/su -c /usr/local/bin/vidalia-wrapper amnesia &
fi
else
invoke-rc.d tor start
fi
# Restart Vidalia because it does not automatically reconnect to the new
# Tor instance. Use kill+start as:
# - X-GNOME-AutoRestart does not exist in Lenny's Gnome
# - we do not start Vidalia automatically anymore and *this* is the time
# when it is supposed to start.
killall vidalia
sleep 2 # give lckdo a chance to release the lockfile
export DISPLAY=':0.0'
exec /bin/su -c /usr/local/bin/vidalia-wrapper amnesia &
[Desktop Entry]
Version=1.0
Name=Vidalia
GenericName=GUI controller for Tor Onion Routing Network
Comment=GUI controller for Tor Onion Routing Network
Exec=/usr/local/bin/vidalia-wrapper
Terminal=false
Type=Application
Icon=/usr/share/pixmaps/vidalia.xpm
Categories=Network;Qt;Security;
#!/usr/bin/perl
use strict;
use warnings;
#man{{{
=head1 NAME
amnesia-htp-notify-user
=head1 VERSION
Version X.XX
=head1 AUTHOR
T(A)ILS dev team <amnesia@boum.org>
See https://amnesia.boum.org/.
=cut
#}}}
use Desktop::Notify;
use Locale::gettext;
use POSIX;
### initialization
setlocale(LC_MESSAGES, "");
textdomain("amnesia-htp-notify-user");
my $htp_done_file='/var/lib/live/htp-done';
### main
my $notify = Desktop::Notify->new();
my $summary = gettext("Synchronizing the system's clock");
my $body = gettext("Tor needs an accurate clock to work properly. Please wait...");
my $notification = $notify->create(summary => $summary,
body => $body,
timeout => 0);
exit 0 if -e $htp_done_file;
$notification->show();
until (-e $htp_done_file) {
sleep 1;
}
$notification->close();
#!/bin/sh
# wait for HTP to finish
until [ -e /var/lib/live/htp-done ]; do
sleep 1
done
sleep 120
exec /usr/local/bin/amnesia-security-check
[[!tag todo/code]]
[[!tag todo/test]]
The Tor connection is not fully functionnal until the HTP has been
completed. The user should be informed s/he must wait.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment