Skip to content

Commit

Permalink
TorInstallationFiles: Remove pidFile
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Aug 20, 2023
1 parent fa9a773 commit ee8fc08
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions network/tor/tor/src/main/java/bisq/tor/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class Constants {
public final static String GEO_IP = "geoip";
public final static String GEO_IPV_6 = "geoip6";
public final static String TORRC = "torrc";
public final static String PID = "pid";
public final static String HOSTNAME = "hostname";
public final static String PRIV_KEY = "private_key";
public final static String TOR_ARCHIVE = "tor.tar.xz";
Expand All @@ -49,7 +48,6 @@ public class Constants {
public final static String TORRC_NATIVE = "torrc.native";
public final static String TORRC_KEY_GEOIP6 = "GeoIPv6File";
public final static String TORRC_KEY_GEOIP = "GeoIPFile";
public final static String TORRC_KEY_PID = "PidFile";
public final static String TORRC_KEY_DATA_DIRECTORY = "DataDirectory";

// Tor control connection
Expand Down
1 change: 0 additions & 1 deletion network/tor/tor/src/main/java/bisq/tor/TorBootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ void deleteVersionFile() {
private Process startTorProcess() throws IOException {
String ownerPid = Pid.getMyPid();
log.debug("Owner pid {}", ownerPid);
torInstallationFiles.writePidToDisk(ownerPid);

TorProcessConfig torProcessConfig = TorProcessConfig.builder()
.torrcFile(torInstallationFiles.getTorrcFile())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@

package bisq.tor.installer;

import bisq.common.util.FileUtils;
import bisq.tor.Constants;
import bisq.tor.OsType;
import lombok.Getter;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;

@Getter
public class TorInstallationFiles {
private final File torDir;
private final File torBinary;
private final File pidFile;
private final File geoIPFile;
private final File geoIPv6File;
private final File torrcFile;
Expand All @@ -39,14 +36,9 @@ public class TorInstallationFiles {
public TorInstallationFiles(Path torDirPath, OsType osType) {
torDir = torDirPath.toFile();
torBinary = new File(torDir, osType.getBinaryName());
pidFile = new File(torDir, Constants.PID);
geoIPFile = new File(torDir, Constants.GEO_IP);
geoIPv6File = new File(torDir, Constants.GEO_IPV_6);
torrcFile = new File(torDir, Constants.TORRC);
versionFile = new File(torDir, Constants.VERSION);
}

public void writePidToDisk(String ownerPid) throws IOException {
FileUtils.writeToFile(ownerPid, pidFile);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ private void extendTorrcFile() throws IOException {
torInstallationFiles.getGeoIPFile().getCanonicalPath());
printWriter.println(Constants.TORRC_KEY_GEOIP6 + " " +
torInstallationFiles.getGeoIPv6File().getCanonicalPath());
printWriter.println(Constants.TORRC_KEY_PID + " " +
torInstallationFiles.getPidFile().getCanonicalPath());
printWriter.println("");
}
}
Expand Down

0 comments on commit ee8fc08

Please sign in to comment.