on start and tor daemon not running, kill all daemons before starting again
To make sure there are not any other daemons still running when trying to start the whole thing again, kill all daemons before starting tor afresh.
This commit is contained in:
parent
2bc85a4a3a
commit
cf0adc27d6
|
@ -167,8 +167,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean findExistingProc ()
|
private boolean findExistingTorDaemon() {
|
||||||
{
|
|
||||||
if (fileTor != null)
|
if (fileTor != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -631,7 +630,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
findExistingProc ();
|
findExistingTorDaemon();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -1305,13 +1304,11 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
boolean found = findExistingProc ();
|
boolean found = findExistingTorDaemon();
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
killProcess(fileTor);
|
killAllDaemons();
|
||||||
killProcess(filePolipo);
|
|
||||||
|
|
||||||
startTor();
|
startTor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue