[Editors]
-Focused=-1
+Focused=43
Order=2,4,6,3,7,25,5,24,39,42,43,-1,1,46,0,49
[Editor_0]
Open=1
Top=0
CursorCol=1
-CursorRow=1
-TopLine=1
+CursorRow=99
+TopLine=73
LeftChar=1
[Editor_2]
Open=1
Top=0
-CursorCol=18
-CursorRow=354
-TopLine=110
+CursorCol=21
+CursorRow=489
+TopLine=437
LeftChar=1
[Editor_3]
[Editor_4]
Open=1
Top=0
-CursorCol=21
-CursorRow=441
-TopLine=407
+CursorCol=12
+CursorRow=78
+TopLine=78
LeftChar=1
[Editor_5]
Top=0
CursorCol=50
CursorRow=31
-TopLine=7
+TopLine=1
LeftChar=1
[Editor_9]
Top=0
CursorCol=17
CursorRow=65
-TopLine=26
+TopLine=1
LeftChar=1
[Editor_10]
Open=1
Top=0
-CursorCol=13
-CursorRow=62
-TopLine=49
+CursorCol=3
+CursorRow=29
+TopLine=70
LeftChar=1
[Editor_11]
[Editor_18]
Open=1
Top=0
-CursorCol=69
-CursorRow=31
+CursorCol=6
+CursorRow=20
TopLine=1
LeftChar=1
Open=1
Top=0
CursorCol=1
-CursorRow=134
-TopLine=116
+CursorRow=77
+TopLine=77
LeftChar=1
[Editor_26]
Open=1
Open=1
Top=0
CursorCol=3
-CursorRow=50
-TopLine=52
+CursorRow=57
+TopLine=28
LeftChar=1
[Editor_33]
Open=1
[Editor_35]
Open=1
Top=0
-CursorCol=1
-CursorRow=29
-TopLine=1
+CursorCol=2
+CursorRow=51
+TopLine=24
LeftChar=1
[Editor_36]
Open=1
LeftChar=1
[Editor_43]
Open=1
-Top=0
-CursorCol=1
-CursorRow=1405
-TopLine=1364
+Top=1
+CursorCol=10
+CursorRow=285
+TopLine=249
LeftChar=1
[Editor_44]
Open=1
[Editor_46]
Open=1
Top=0
-CursorCol=13
-CursorRow=154
-TopLine=1
+CursorCol=1
+CursorRow=77
+TopLine=24
LeftChar=1
[Editor_47]
Open=1
-Top=1
-CursorCol=138
-CursorRow=103
-TopLine=96
+Top=0
+CursorCol=1
+CursorRow=157
+TopLine=4
LeftChar=1
[Editor_48]
Open=1
Top=0
CursorCol=11
CursorRow=82
-TopLine=53
+TopLine=2
LeftChar=1
[Editor_49]
Open=1
Top=0
CursorCol=1
CursorRow=211
-TopLine=203
+TopLine=167
LeftChar=1
[Editor_51]
Open=1
Top=0
CursorCol=12
CursorRow=57
-TopLine=28
+TopLine=19
LeftChar=1
[Editor_52]
Open=1
Top=0
CursorCol=2
CursorRow=39
-TopLine=4
+TopLine=43
LeftChar=1
[Editor_53]
Open=1
Top=0
CursorCol=1
CursorRow=58
-TopLine=16
+TopLine=1
LeftChar=1
[Editor_54]
Open=1
Top=0
CursorCol=1
CursorRow=29
-TopLine=2
+TopLine=14
LeftChar=1
extern std::vector<int> fd_reap;
extern std::vector<std::string> module_names;
-extern char bannerBuffer[MAXBUF];
extern int boundPortCount;
extern int portCount;
extern int UDPportCount;
extern int MaxWhoResults;
extern time_t nb_start;
+extern bool nofork;
+
extern std::vector<int> fd_reap;
extern std::vector<std::string> module_names;
-extern char bannerBuffer[MAXBUF];
+extern char MyExecutable[1024];
extern int boundPortCount;
extern int portCount;
extern int UDPportCount;
void handle_restart(char **parameters, int pcnt, userrec *user)
{
- log(DEBUG,"restart: %s",user->nick);
+ char restart[1024];
+ char *argv[32];
+ log(DEFAULT,"Restart: %s",user->nick);
if (!strcmp(parameters[0],restartpass))
{
- WriteOpers("*** RESTART command from %s!%s@%s, Pretending to restart till this is finished :D",user->nick,user->ident,user->host);
- sleep(DieDelay);
- Exit(ERROR);
- /* Will finish this later when i can be arsed :) */
+ WriteOpers("*** RESTART command from %s!%s@%s, restarting server.",user->nick,user->ident,user->host);
+
+ argv[0] = MyExecutable;
+ argv[1] = "-wait";
+ if (nofork)
+ {
+ argv[2] = "-nofork";
+ }
+ else
+ {
+ argv[2] = NULL;
+ }
+ argv[3] = NULL;
+
+ // close ALL file descriptors
+ send_error("Server restarting.");
+ sleep(1);
+ for (int i = 0; i < 65536; i++)
+ {
+ int on = 0;
+ struct linger linger = { 0 };
+ setsockopt(i, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));
+ linger.l_onoff = 1;
+ linger.l_linger = 0;
+ setsockopt(i, SOL_SOCKET, SO_LINGER, (const char*)&linger,sizeof(linger));
+ Blocking(i);
+ close(i);
+ }
+ sleep(5);
+
+ execv(MyExecutable,argv);
+
+ exit(0);
}
else
{
ClassVector Classes;
struct linger linger = { 0 };
-char bannerBuffer[MAXBUF];
+char MyExecutable[1024];
int boundPortCount = 0;
int portCount = 0, UDPportCount = 0, ports[MAXSOCKS];
int defaultRoute = 0;
}
-int main(int argc, char *argv[])
+int main(int argc, char **argv)
{
Start();
srand(time(NULL));
Exit(ERROR);
}
if (argc > 1) {
- if (!strcmp(argv[1],"-nofork")) {
- nofork = true;
+ for (int i = 1; i < argc; i++)
+ {
+ if (!strcmp(argv[i],"-nofork")) {
+ nofork = true;
+ }
+ if (!strcmp(argv[i],"-wait")) {
+ sleep(6);
+ }
}
}
+ strcpy(MyExecutable,argv[0]);
+
if (InspIRCd() == ERROR)
{
log(DEBUG,"main: daemon function bailed");
log(DEBUG,"InspIRCd: startup: binding '%s:%s' is default server route",Addr,configToken);
}
me[count3] = new serverrec(ServerName,100L,false);
- me[count3]->CreateListener(Addr,atoi(configToken));
- count3++;
+ if (!me[count3]->CreateListener(Addr,atoi(configToken)))
+ {
+ log(DEFAULT,"Error! Failed to bind port %d",atoi(configToken));
+ }
+ else
+ {
+ count3++;
+ }
}
else
{
extern std::vector<int> fd_reap;
extern std::vector<std::string> module_names;
-extern char bannerBuffer[MAXBUF];
extern int boundPortCount;
extern int portCount;
extern int UDPportCount;
extern std::vector<int> fd_reap;
extern std::vector<std::string> module_names;
-extern char bannerBuffer[MAXBUF];
extern int boundPortCount;
extern int portCount;
extern int UDPportCount;