diff --git a/defaults/yacy.init b/defaults/yacy.init index 1516677dd..dbbc5a75c 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -435,14 +435,6 @@ browserPopUpTrigger=true browserPopUpPage=Status.html browserPopUpApplication=netscape -# the proxy saves it's own seed information. It is positive for the network if -# the seed does not change it's configuration often (or not at all). -# The reason for that is that the seed hash is the target for the -# distributed hash table distribution function. -# The following file will contain the saved seed: -yacyOwnSeedFile=DATA/YACYDB/mySeed.txt -yacyDB=DATA/YACYDB - # index sharing attributes: by default, sharing is on. # If you want to use YaCy only for local indexing (robinson mode), # you may switch this off diff --git a/killYACY.sh b/killYACY.sh index 6c44e28f0..9790166f2 100755 --- a/killYACY.sh +++ b/killYACY.sh @@ -4,7 +4,7 @@ # To stop YaCy, use stopYACY.sh cd `dirname $0` -PID=`fuser DATA/LOG/yacy00.log | awk '{print $2}'` +PID=`fuser DATA/LOG/yacy00.log | awk '{print $1}'` echo "process-id is " $PID kill -3 $PID sleep 1 diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 202f75121..7363a8a2a 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -627,8 +627,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitchName of the setting how many active crawler-threads may maximal be running on the same time

*/ public static final String CRAWLER_THREADS_ACTIVE_MAX = "crawler.MaxActiveThreads"; - - public static final String OWN_SEED_FILE = "yacyOwnSeedFile"; public static final String YACY_MODE_DEBUG = "yacyDebugMode"; public static final String WORDCACHE_INIT_COUNT = "wordCacheInitCount"; /** @@ -814,11 +812,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitchpublic static final String DBFILE_OWN_SEED = "mySeed.txt"

- *

Name of the file containing the database holding this peer's seed

- */ - public static final String DBFILE_OWN_SEED = "mySeed.txt"; /** *

public static final String DBFILE_CRAWL_PROFILES = "crawlProfiles0.db" *

Name of the file containing the database holding all recent crawl profiles

@@ -2057,14 +2050,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch - * @return a new File instance - */ - public File getOwnSeedFile() { - return getConfigPath(OWN_SEED_FILE, DBFILE_OWN_SEED); - } - /** * With this function the crawling process can be paused * @param jobType diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index 84e3bc86f..1e3e55720 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -120,7 +120,7 @@ public final class plasmaWordIndex implements indexRI { // create or init seed cache File networkRoot = new File(this.primaryRoot, "NETWORK"); networkRoot.mkdirs(); - File mySeedFile = new File(networkRoot, "mySeed.txt"); + File mySeedFile = new File(networkRoot, yacySeedDB.DBFILE_OWN_SEED); File oldSeedFile = new File(new File(indexPrimaryRoot.getParentFile(), "YACYDB"), "mySeed.txt"); if (oldSeedFile.exists()) oldSeedFile.renameTo(mySeedFile); seedDB = new yacySeedDB( diff --git a/source/de/anomic/yacy/yacyCore.java b/source/de/anomic/yacy/yacyCore.java index 708b5892e..5a4ba2182 100644 --- a/source/de/anomic/yacy/yacyCore.java +++ b/source/de/anomic/yacy/yacyCore.java @@ -117,7 +117,6 @@ public class yacyCore { // create a peer news channel RSSFeed peernews = RSSFeed.channels(RSSFeed.PEERNEWS); - peernews.setMaxsize(1000); peernews.addMessage(new RSSMessage("YaCy started", "", "")); loadSeedUploadMethods(); @@ -406,7 +405,7 @@ public class yacyCore { // going through the peer list and starting a new publisher thread for each peer int i = 0; - while (si. hasNext()) { + while (si.hasNext()) { seed = (yacySeed) si.next(); if (seed == null) { sync.P(); @@ -503,17 +502,15 @@ public class yacyCore { log.logInfo("PeerPing: No data, staying at myType: " + sb.wordIndex.seedDB.mySeed().orVirgin()); } - if (newSeeds >= 0) { - // success! we have published our peer to a senior peer - // update latest news from the other peer - // log.logInfo("publish: handshaked " + t.seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + t.seed.getName() + "' at " + t.seed.getAddress()); - peerActions.saveMySeed(); - return newSeeds; - } + // success! we have published our peer to a senior peer + // update latest news from the other peer + // log.logInfo("publish: handshaked " + t.seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + t.seed.getName() + "' at " + t.seed.getAddress()); + sb.wordIndex.seedDB.saveMySeed(); // if we have an address, we do nothing if (sb.wordIndex.seedDB.mySeed().isProper() == null && !force) { return 0; } - + if (newSeeds > 0) return newSeeds; + // still no success: ask own NAT or internet responder //final boolean DI604use = switchboard.getConfig("DI604use", "false").equals("true"); //final String DI604pw = switchboard.getConfig("DI604pw", ""); @@ -526,7 +523,7 @@ public class yacyCore { sb.wordIndex.seedDB.mySeed().put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR); // to start bootstraping, we need to be recognised as PEERTYPE_SENIOR peer log.logInfo("publish: no recipient found, our address is " + ((sb.wordIndex.seedDB.mySeed().getPublicAddress() == null) ? "unknown" : sb.wordIndex.seedDB.mySeed().getPublicAddress())); - peerActions.saveMySeed(); + sb.wordIndex.seedDB.saveMySeed(); return 0; } catch (InterruptedException e) { try { diff --git a/source/de/anomic/yacy/yacyNewsPool.java b/source/de/anomic/yacy/yacyNewsPool.java index d8acaac48..cb2fe774f 100644 --- a/source/de/anomic/yacy/yacyNewsPool.java +++ b/source/de/anomic/yacy/yacyNewsPool.java @@ -263,7 +263,6 @@ public class yacyNewsPool { private yacyNewsQueue outgoingNews, publishedNews, incomingNews, processedNews; private int maxDistribution; - public yacyNewsPool(File yacyDBPath) { newsDB = new yacyNewsDB(new File(yacyDBPath, "news.db")); outgoingNews = new yacyNewsQueue(new File(yacyDBPath, "newsOut.stack"), newsDB); diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.java index 13dd715c6..84f237e8f 100644 --- a/source/de/anomic/yacy/yacyPeerActions.java +++ b/source/de/anomic/yacy/yacyPeerActions.java @@ -127,12 +127,6 @@ public class yacyPeerActions { seedDB.mySeed().setFlagAcceptRemoteIndex(sb.getConfig("allowReceiveIndex", "").equals("true")); //mySeed.setFlagAcceptRemoteIndex(true); } - - public void saveMySeed() { - try { - seedDB.mySeed().save(sb.getOwnSeedFile()); - } catch (IOException e) {} - } public void loadSeedLists() { // uses the superseed to initialize the database with known seeds diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.java index bbc91acb6..1351f6aa5 100644 --- a/source/de/anomic/yacy/yacySeed.java +++ b/source/de/anomic/yacy/yacySeed.java @@ -875,7 +875,7 @@ public class yacySeed { } public final void save(File f) throws IOException { - final String out = this.genSeedStr('z', null); + final String out = this.genSeedStr('p', null); final FileWriter fw = new FileWriter(f); fw.write(out, 0, out.length()); fw.close(); diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.java index 9583189b5..53ff67fd8 100644 --- a/source/de/anomic/yacy/yacySeedDB.java +++ b/source/de/anomic/yacy/yacySeedDB.java @@ -93,6 +93,12 @@ public final class yacySeedDB implements httpdAlternativeDomainNames { public static final int commonHashLength = 12; public static final int dhtActivityMagic = 32; + /** + *

public static final String DBFILE_OWN_SEED = "mySeed.txt"

+ *

Name of the file containing the database holding this peer's seed

+ */ + public static final String DBFILE_OWN_SEED = "mySeed.txt"; + public static final String[] sortFields = new String[] {yacySeed.LCOUNT, yacySeed.ICOUNT, yacySeed.UPTIME, yacySeed.VERSION, yacySeed.LASTSEEN}; public static final String[] longaccFields = new String[] {yacySeed.LCOUNT, yacySeed.ICOUNT, yacySeed.ISPEED}; public static final String[] doubleaccFields = new String[] {yacySeed.RSPEED}; @@ -215,6 +221,12 @@ public final class yacySeedDB implements httpdAlternativeDomainNames { } catch (IOException e) {} } + public void saveMySeed() { + try { + this.mySeed().save(myOwnSeedFile); + } catch (IOException e) {} + } + public boolean noDHTActivity() { // for small networks, we don't perform DHT transmissions, because it is possible to search over all peers return this.sizeConnected() <= dhtActivityMagic;