projects
/
org.ibex.mail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7e733c6
)
support for filesystem-based restart
author
adam
<adam@megacz.com>
Sun, 21 Jan 2007 23:19:09 +0000
(23:19 +0000)
committer
adam
<adam@megacz.com>
Sun, 21 Jan 2007 23:19:09 +0000
(23:19 +0000)
darcs-hash:
20070121231909
-5007d-
61a2f85a9b90cec7dc34472a50668912e776b27b
.gz
src/org/ibex/mail/Main.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/mail/Main.java
b/src/org/ibex/mail/Main.java
index
e4971ed
..
0638a33
100644
(file)
--- a/
src/org/ibex/mail/Main.java
+++ b/
src/org/ibex/mail/Main.java
@@
-18,6
+18,10
@@
import org.ibex.jetty.*;
public class Main implements Listener {
public static void main(String[] s) throws Exception {
public class Main implements Listener {
public static void main(String[] s) throws Exception {
+ try {
+ File f = new File(Mailbox.STORAGE_ROOT + "/restart");
+ if (f.exists()) f.delete();
+ } catch (Exception e) { Log.error(Main.class, e); }
new Main().main();
}
new Main().main();
}
@@
-25,6
+29,20
@@
public class Main implements Listener {
ServerSocket sock143 = new ServerSocket(143);
ServerSocket sock119 = new ServerSocket(119);
ServerSocket sock25 = new ServerSocket(25);
ServerSocket sock143 = new ServerSocket(143);
ServerSocket sock119 = new ServerSocket(119);
ServerSocket sock25 = new ServerSocket(25);
+ new Thread() {
+ public void run() {
+ while(true) {
+ try { Thread.sleep(500); } catch (Exception e) { }
+ try {
+ File f = new File(Mailbox.STORAGE_ROOT + "/restart");
+ if (f.exists()) {
+ Log.error("RESTART", "restarting...");
+ System.exit(0);
+ }
+ } catch (Exception e) { Log.error(this, e); }
+ }
+ }
+ }.start();
new Acceptor(sock143).start();
new Acceptor(sock119).start();
new Acceptor(sock25).start();
new Acceptor(sock143).start();
new Acceptor(sock119).start();
new Acceptor(sock25).start();