| 22 |
|
* $Id$ |
| 23 |
|
*/ |
| 24 |
|
|
| 25 |
+ |
#include "ltdl.h" |
| 26 |
+ |
|
| 27 |
|
#include "stdinc.h" |
| 28 |
|
#include "list.h" |
| 29 |
|
#include "modules.h" |
| 30 |
< |
#include "s_log.h" |
| 30 |
> |
#include "log.h" |
| 31 |
|
#include "ircd.h" |
| 32 |
|
#include "client.h" |
| 33 |
|
#include "send.h" |
| 34 |
< |
#include "s_conf.h" |
| 33 |
< |
#include "handlers.h" |
| 34 |
> |
#include "conf.h" |
| 35 |
|
#include "numeric.h" |
| 36 |
|
#include "parse.h" |
| 37 |
|
#include "ircd_defs.h" |
| 39 |
|
#include "memory.h" |
| 40 |
|
|
| 41 |
|
|
| 42 |
< |
dlink_list mod_list = { NULL, NULL, 0 }; |
| 42 |
> |
dlink_list modules_list = { NULL, NULL, 0 }; |
| 43 |
> |
|
| 44 |
> |
static const char *unknown_ver = "<unknown>"; |
| 45 |
|
|
| 46 |
|
static const char *core_module_table[] = |
| 47 |
|
{ |
| 64 |
|
static dlink_list mod_paths = { NULL, NULL, 0 }; |
| 65 |
|
static dlink_list conf_modules = { NULL, NULL, 0 }; |
| 66 |
|
|
| 67 |
< |
static void mo_modload(struct Client *, struct Client *, int, char *[]); |
| 68 |
< |
static void mo_modlist(struct Client *, struct Client *, int, char *[]); |
| 69 |
< |
static void mo_modreload(struct Client *, struct Client *, int, char *[]); |
| 70 |
< |
static void mo_modunload(struct Client *, struct Client *, int, char *[]); |
| 71 |
< |
static void mo_modrestart(struct Client *, struct Client *, int, char *[]); |
| 69 |
< |
|
| 70 |
< |
struct Message modload_msgtab = { |
| 71 |
< |
"MODLOAD", 0, 0, 2, 0, MFLG_SLOW, 0, |
| 72 |
< |
{m_unregistered, m_not_oper, m_ignore, m_ignore, mo_modload, m_ignore} |
| 73 |
< |
}; |
| 67 |
> |
int |
| 68 |
> |
modules_valid_suffix(const char *name) |
| 69 |
> |
{ |
| 70 |
> |
return ((name = strrchr(name, '.'))) && !strcmp(name, ".la"); |
| 71 |
> |
} |
| 72 |
|
|
| 73 |
< |
struct Message modunload_msgtab = { |
| 74 |
< |
"MODUNLOAD", 0, 0, 2, 0, MFLG_SLOW, 0, |
| 75 |
< |
{m_unregistered, m_not_oper, m_ignore, m_ignore, mo_modunload, m_ignore} |
| 76 |
< |
}; |
| 73 |
> |
/* unload_one_module() |
| 74 |
> |
* |
| 75 |
> |
* inputs - name of module to unload |
| 76 |
> |
* - 1 to say modules unloaded, 0 to not |
| 77 |
> |
* output - 0 if successful, -1 if error |
| 78 |
> |
* side effects - module is unloaded |
| 79 |
> |
*/ |
| 80 |
> |
int |
| 81 |
> |
unload_one_module(const char *name, int warn) |
| 82 |
> |
{ |
| 83 |
> |
struct module *modp = NULL; |
| 84 |
|
|
| 85 |
< |
struct Message modreload_msgtab = { |
| 86 |
< |
"MODRELOAD", 0, 0, 2, 0, MFLG_SLOW, 0, |
| 82 |
< |
{m_unregistered, m_not_oper, m_ignore, m_ignore, mo_modreload, m_ignore} |
| 83 |
< |
}; |
| 85 |
> |
if ((modp = findmodule_byname(name)) == NULL) |
| 86 |
> |
return -1; |
| 87 |
|
|
| 88 |
< |
struct Message modlist_msgtab = { |
| 89 |
< |
"MODLIST", 0, 0, 0, 0, MFLG_SLOW, 0, |
| 87 |
< |
{m_unregistered, m_not_oper, m_ignore, m_ignore, mo_modlist, m_ignore} |
| 88 |
< |
}; |
| 88 |
> |
if (modp->modexit) |
| 89 |
> |
modp->modexit(); |
| 90 |
|
|
| 91 |
< |
struct Message modrestart_msgtab = { |
| 92 |
< |
"MODRESTART", 0, 0, 0, 0, MFLG_SLOW, 0, |
| 93 |
< |
{m_unregistered, m_not_oper, m_ignore, m_ignore, mo_modrestart, m_ignore} |
| 94 |
< |
}; |
| 91 |
> |
assert(dlink_list_length(&modules_list) > 0); |
| 92 |
> |
dlinkDelete(&modp->node, &modules_list); |
| 93 |
> |
MyFree(modp->name); |
| 94 |
> |
|
| 95 |
> |
lt_dlclose(modp->handle); |
| 96 |
> |
|
| 97 |
> |
if (warn == 1) |
| 98 |
> |
{ |
| 99 |
> |
ilog(LOG_TYPE_IRCD, "Module %s unloaded", name); |
| 100 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 101 |
> |
"Module %s unloaded", name); |
| 102 |
> |
} |
| 103 |
> |
|
| 104 |
> |
return 0; |
| 105 |
> |
} |
| 106 |
> |
|
| 107 |
> |
/* load_a_module() |
| 108 |
> |
* |
| 109 |
> |
* inputs - path name of module, int to notice, int of core |
| 110 |
> |
* output - -1 if error 0 if success |
| 111 |
> |
* side effects - loads a module if successful |
| 112 |
> |
*/ |
| 113 |
> |
int |
| 114 |
> |
load_a_module(const char *path, int warn) |
| 115 |
> |
{ |
| 116 |
> |
lt_dlhandle tmpptr = NULL; |
| 117 |
> |
const char *mod_basename = NULL; |
| 118 |
> |
struct module *modp = NULL; |
| 119 |
> |
|
| 120 |
> |
if (findmodule_byname((mod_basename = libio_basename(path)))) |
| 121 |
> |
return 1; |
| 122 |
> |
|
| 123 |
> |
if (!(tmpptr = lt_dlopen(path))) { |
| 124 |
> |
const char *err = ((err = lt_dlerror())) ? err : "<unknown>"; |
| 125 |
> |
|
| 126 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 127 |
> |
"Error loading module %s: %s", |
| 128 |
> |
mod_basename, err); |
| 129 |
> |
ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err); |
| 130 |
> |
return -1; |
| 131 |
> |
} |
| 132 |
> |
|
| 133 |
> |
if ((modp = lt_dlsym(tmpptr, "module_entry")) == NULL) |
| 134 |
> |
{ |
| 135 |
> |
const char *err = ((err = lt_dlerror())) ? err : "<unknown>"; |
| 136 |
> |
|
| 137 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 138 |
> |
"Error loading module %s: %s", |
| 139 |
> |
mod_basename, err); |
| 140 |
> |
ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err); |
| 141 |
> |
lt_dlclose(tmpptr); |
| 142 |
> |
return -1; |
| 143 |
> |
} |
| 144 |
|
|
| 145 |
+ |
modp->handle = tmpptr; |
| 146 |
+ |
|
| 147 |
+ |
if (EmptyString(modp->version)) |
| 148 |
+ |
modp->version = unknown_ver; |
| 149 |
+ |
|
| 150 |
+ |
modp->name = xstrdup(mod_basename); |
| 151 |
+ |
dlinkAdd(modp, &modp->node, &modules_list); |
| 152 |
+ |
|
| 153 |
+ |
if (modp->modinit) |
| 154 |
+ |
modp->modinit(); |
| 155 |
+ |
|
| 156 |
+ |
if (warn == 1) |
| 157 |
+ |
{ |
| 158 |
+ |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 159 |
+ |
"Module %s [version: %s handle: %p] loaded.", |
| 160 |
+ |
modp->name, modp->version, tmpptr); |
| 161 |
+ |
ilog(LOG_TYPE_IRCD, "Module %s [version: %s handle: %p] loaded.", |
| 162 |
+ |
modp->name, modp->version, tmpptr); |
| 163 |
+ |
} |
| 164 |
+ |
|
| 165 |
+ |
return 0; |
| 166 |
+ |
} |
| 167 |
|
|
| 168 |
|
/* |
| 169 |
|
* modules_init |
| 175 |
|
void |
| 176 |
|
modules_init(void) |
| 177 |
|
{ |
| 178 |
< |
dynlink_init(); |
| 179 |
< |
|
| 180 |
< |
mod_add_cmd(&modload_msgtab); |
| 181 |
< |
mod_add_cmd(&modunload_msgtab); |
| 182 |
< |
mod_add_cmd(&modreload_msgtab); |
| 183 |
< |
mod_add_cmd(&modlist_msgtab); |
| 112 |
< |
mod_add_cmd(&modrestart_msgtab); |
| 178 |
> |
if (lt_dlinit()) |
| 179 |
> |
{ |
| 180 |
> |
ilog(LOG_TYPE_IRCD, "Couldn't initialize the libltdl run time dynamic" |
| 181 |
> |
" link library. Exiting."); |
| 182 |
> |
exit(0); |
| 183 |
> |
} |
| 184 |
|
} |
| 185 |
|
|
| 186 |
|
/* mod_find_path() |
| 193 |
|
mod_find_path(const char *path) |
| 194 |
|
{ |
| 195 |
|
dlink_node *ptr; |
| 125 |
– |
struct module_path *mpath; |
| 196 |
|
|
| 197 |
|
DLINK_FOREACH(ptr, mod_paths.head) |
| 198 |
|
{ |
| 199 |
< |
mpath = ptr->data; |
| 199 |
> |
struct module_path *mpath = ptr->data; |
| 200 |
|
|
| 201 |
|
if (!strcmp(path, mpath->path)) |
| 202 |
|
return mpath; |
| 251 |
|
void |
| 252 |
|
mod_clear_paths(void) |
| 253 |
|
{ |
| 254 |
< |
struct module_path *pathst; |
| 185 |
< |
dlink_node *ptr; |
| 186 |
< |
dlink_node *next_ptr; |
| 254 |
> |
dlink_node *ptr = NULL, *next_ptr = NULL; |
| 255 |
|
|
| 256 |
|
DLINK_FOREACH_SAFE(ptr, next_ptr, mod_paths.head) |
| 257 |
|
{ |
| 258 |
< |
pathst = ptr->data; |
| 259 |
< |
|
| 192 |
< |
dlinkDelete(&pathst->node, &mod_paths); |
| 193 |
< |
MyFree(pathst); |
| 258 |
> |
dlinkDelete(ptr, &mod_paths); |
| 259 |
> |
MyFree(ptr->data); |
| 260 |
|
} |
| 261 |
|
|
| 262 |
|
DLINK_FOREACH_SAFE(ptr, next_ptr, conf_modules.head) |
| 263 |
|
{ |
| 264 |
< |
pathst = ptr->data; |
| 265 |
< |
|
| 200 |
< |
dlinkDelete(&pathst->node, &conf_modules); |
| 201 |
< |
MyFree(pathst); |
| 264 |
> |
dlinkDelete(ptr, &conf_modules); |
| 265 |
> |
MyFree(ptr->data); |
| 266 |
|
} |
| 267 |
|
} |
| 268 |
|
|
| 277 |
|
{ |
| 278 |
|
dlink_node *ptr = NULL; |
| 279 |
|
|
| 280 |
< |
DLINK_FOREACH(ptr, mod_list.head) |
| 280 |
> |
DLINK_FOREACH(ptr, modules_list.head) |
| 281 |
|
{ |
| 282 |
|
struct module *modp = ptr->data; |
| 283 |
|
|
| 301 |
|
struct dirent *ldirent = NULL; |
| 302 |
|
char module_fq_name[PATH_MAX + 1]; |
| 303 |
|
|
| 240 |
– |
modules_init(); |
| 241 |
– |
|
| 304 |
|
if ((system_module_dir = opendir(AUTOMODPATH)) == NULL) |
| 305 |
|
{ |
| 306 |
< |
ilog(L_WARN, "Could not load modules from %s: %s", |
| 306 |
> |
ilog(LOG_TYPE_IRCD, "Could not load modules from %s: %s", |
| 307 |
|
AUTOMODPATH, strerror(errno)); |
| 308 |
|
return; |
| 309 |
|
} |
| 314 |
|
{ |
| 315 |
|
snprintf(module_fq_name, sizeof(module_fq_name), "%s/%s", |
| 316 |
|
AUTOMODPATH, ldirent->d_name); |
| 317 |
< |
load_a_module(module_fq_name, warn, 0); |
| 317 |
> |
load_a_module(module_fq_name, warn); |
| 318 |
|
} |
| 319 |
|
} |
| 320 |
|
|
| 331 |
|
load_conf_modules(void) |
| 332 |
|
{ |
| 333 |
|
dlink_node *ptr = NULL; |
| 272 |
– |
struct module_path *mpath = NULL; |
| 334 |
|
|
| 335 |
|
DLINK_FOREACH(ptr, conf_modules.head) |
| 336 |
|
{ |
| 337 |
< |
mpath = ptr->data; |
| 337 |
> |
struct module_path *mpath = ptr->data; |
| 338 |
|
|
| 339 |
|
if (findmodule_byname(mpath->path) == NULL) |
| 340 |
< |
load_one_module(mpath->path, 0); |
| 340 |
> |
load_one_module(mpath->path); |
| 341 |
|
} |
| 342 |
|
} |
| 343 |
|
|
| 358 |
|
snprintf(module_name, sizeof(module_name), "%s%s", |
| 359 |
|
MODPATH, core_module_table[i]); |
| 360 |
|
|
| 361 |
< |
if (load_a_module(module_name, warn, 1) == -1) |
| 361 |
> |
if (load_a_module(module_name, warn) == -1) |
| 362 |
|
{ |
| 363 |
< |
ilog(L_CRIT, "Error loading core module %s: terminating ircd", |
| 363 |
> |
ilog(LOG_TYPE_IRCD, "Error loading core module %s: terminating ircd", |
| 364 |
|
core_module_table[i]); |
| 365 |
|
exit(EXIT_FAILURE); |
| 366 |
|
} |
| 375 |
|
* side effects - module is loaded if found. |
| 376 |
|
*/ |
| 377 |
|
int |
| 378 |
< |
load_one_module(const char *path, int coremodule) |
| 378 |
> |
load_one_module(const char *path) |
| 379 |
|
{ |
| 380 |
|
dlink_node *ptr = NULL; |
| 381 |
|
char modpath[PATH_MAX + 1]; |
| 392 |
|
|
| 393 |
|
if (strstr(modpath, "../") == NULL && |
| 394 |
|
strstr(modpath, "/..") == NULL) |
| 334 |
– |
{ |
| 395 |
|
if (!stat(modpath, &statbuf)) |
| 396 |
< |
{ |
| 397 |
< |
if (S_ISREG(statbuf.st_mode)) |
| 338 |
< |
{ |
| 339 |
< |
/* Regular files only please */ |
| 340 |
< |
return load_a_module(modpath, 1, coremodule); |
| 341 |
< |
} |
| 342 |
< |
} |
| 343 |
< |
} |
| 396 |
> |
if (S_ISREG(statbuf.st_mode)) /* Regular files only please */ |
| 397 |
> |
return load_a_module(modpath, 1); |
| 398 |
|
} |
| 399 |
|
|
| 400 |
< |
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 400 |
> |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
| 401 |
|
"Cannot locate module %s", path); |
| 402 |
< |
ilog(L_WARN, "Cannot locate module %s", path); |
| 402 |
> |
ilog(LOG_TYPE_IRCD, "Cannot locate module %s", path); |
| 403 |
|
return -1; |
| 404 |
|
} |
| 351 |
– |
|
| 352 |
– |
/* load a module .. */ |
| 353 |
– |
static void |
| 354 |
– |
mo_modload(struct Client *client_p, struct Client *source_p, |
| 355 |
– |
int parc, char *parv[]) |
| 356 |
– |
{ |
| 357 |
– |
const char *m_bn = NULL; |
| 358 |
– |
|
| 359 |
– |
if (!HasOFlag(source_p, OPER_FLAG_MODULE)) |
| 360 |
– |
{ |
| 361 |
– |
sendto_one(source_p, form_str(ERR_NOPRIVILEGES), |
| 362 |
– |
me.name, source_p->name); |
| 363 |
– |
return; |
| 364 |
– |
} |
| 365 |
– |
|
| 366 |
– |
m_bn = libio_basename(parv[1]); |
| 367 |
– |
|
| 368 |
– |
if (findmodule_byname(m_bn) != NULL) |
| 369 |
– |
{ |
| 370 |
– |
sendto_one(source_p, ":%s NOTICE %s :Module %s is already loaded", |
| 371 |
– |
me.name, source_p->name, m_bn); |
| 372 |
– |
return; |
| 373 |
– |
} |
| 374 |
– |
|
| 375 |
– |
load_one_module(parv[1], 0); |
| 376 |
– |
} |
| 377 |
– |
|
| 378 |
– |
/* unload a module .. */ |
| 379 |
– |
static void |
| 380 |
– |
mo_modunload(struct Client *client_p, struct Client *source_p, |
| 381 |
– |
int parc, char *parv[]) |
| 382 |
– |
{ |
| 383 |
– |
const char *m_bn = NULL; |
| 384 |
– |
struct module *modp = NULL; |
| 385 |
– |
|
| 386 |
– |
if (!HasOFlag(source_p, OPER_FLAG_MODULE)) |
| 387 |
– |
{ |
| 388 |
– |
sendto_one(source_p, form_str(ERR_NOPRIVILEGES), |
| 389 |
– |
me.name, source_p->name); |
| 390 |
– |
return; |
| 391 |
– |
} |
| 392 |
– |
|
| 393 |
– |
m_bn = libio_basename(parv[1]); |
| 394 |
– |
|
| 395 |
– |
if ((modp = findmodule_byname(m_bn)) == NULL) |
| 396 |
– |
{ |
| 397 |
– |
sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded", |
| 398 |
– |
me.name, source_p->name, m_bn); |
| 399 |
– |
return; |
| 400 |
– |
} |
| 401 |
– |
|
| 402 |
– |
if (modp->flags & MODULE_FLAG_CORE) |
| 403 |
– |
{ |
| 404 |
– |
sendto_one(source_p, |
| 405 |
– |
":%s NOTICE %s :Module %s is a core module and may not be unloaded", |
| 406 |
– |
me.name, source_p->name, m_bn); |
| 407 |
– |
return; |
| 408 |
– |
} |
| 409 |
– |
|
| 410 |
– |
if (unload_one_module(m_bn, 1) == -1) |
| 411 |
– |
{ |
| 412 |
– |
sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded", |
| 413 |
– |
me.name, source_p->name, m_bn); |
| 414 |
– |
} |
| 415 |
– |
} |
| 416 |
– |
|
| 417 |
– |
/* unload and load in one! */ |
| 418 |
– |
static void |
| 419 |
– |
mo_modreload(struct Client *client_p, struct Client *source_p, |
| 420 |
– |
int parc, char *parv[]) |
| 421 |
– |
{ |
| 422 |
– |
const char *m_bn = NULL; |
| 423 |
– |
struct module *modp = NULL; |
| 424 |
– |
int check_core; |
| 425 |
– |
|
| 426 |
– |
if (!HasOFlag(source_p, OPER_FLAG_MODULE)) |
| 427 |
– |
{ |
| 428 |
– |
sendto_one(source_p, form_str(ERR_NOPRIVILEGES), |
| 429 |
– |
me.name, source_p->name); |
| 430 |
– |
return; |
| 431 |
– |
} |
| 432 |
– |
|
| 433 |
– |
m_bn = libio_basename(parv[1]); |
| 434 |
– |
|
| 435 |
– |
if ((modp = findmodule_byname(m_bn)) == NULL) |
| 436 |
– |
{ |
| 437 |
– |
sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded", |
| 438 |
– |
me.name, source_p->name, m_bn); |
| 439 |
– |
return; |
| 440 |
– |
} |
| 441 |
– |
|
| 442 |
– |
check_core = (modp->flags & MODULE_FLAG_CORE) != 0; |
| 443 |
– |
|
| 444 |
– |
if (unload_one_module(m_bn, 1) == -1) |
| 445 |
– |
{ |
| 446 |
– |
sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded", |
| 447 |
– |
me.name, source_p->name, m_bn); |
| 448 |
– |
return; |
| 449 |
– |
} |
| 450 |
– |
|
| 451 |
– |
if ((load_one_module(parv[1], check_core) == -1) && check_core) |
| 452 |
– |
{ |
| 453 |
– |
sendto_realops_flags(UMODE_ALL, L_ALL, "Error reloading core " |
| 454 |
– |
"module: %s: terminating ircd", parv[1]); |
| 455 |
– |
ilog(L_CRIT, "Error loading core module %s: terminating ircd", parv[1]); |
| 456 |
– |
exit(0); |
| 457 |
– |
} |
| 458 |
– |
} |
| 459 |
– |
|
| 460 |
– |
/* list modules .. */ |
| 461 |
– |
static void |
| 462 |
– |
mo_modlist(struct Client *client_p, struct Client *source_p, |
| 463 |
– |
int parc, char *parv[]) |
| 464 |
– |
{ |
| 465 |
– |
const dlink_node *ptr = NULL; |
| 466 |
– |
|
| 467 |
– |
if (!HasOFlag(source_p, OPER_FLAG_MODULE)) |
| 468 |
– |
{ |
| 469 |
– |
sendto_one(source_p, form_str(ERR_NOPRIVILEGES), |
| 470 |
– |
me.name, source_p->name); |
| 471 |
– |
return; |
| 472 |
– |
} |
| 473 |
– |
|
| 474 |
– |
DLINK_FOREACH(ptr, mod_list.head) |
| 475 |
– |
{ |
| 476 |
– |
const struct module *modp = ptr->data; |
| 477 |
– |
|
| 478 |
– |
if (parc > 1 && !match(parv[1], modp->name)) |
| 479 |
– |
continue; |
| 480 |
– |
|
| 481 |
– |
sendto_one(source_p, form_str(RPL_MODLIST), me.name, parv[0], |
| 482 |
– |
modp->name, modp->handle, |
| 483 |
– |
modp->version, (modp->flags & MODULE_FLAG_CORE) ?"(core)":""); |
| 484 |
– |
} |
| 485 |
– |
|
| 486 |
– |
sendto_one(source_p, form_str(RPL_ENDOFMODLIST), |
| 487 |
– |
me.name, source_p->name); |
| 488 |
– |
} |
| 489 |
– |
|
| 490 |
– |
/* unload and reload all modules */ |
| 491 |
– |
static void |
| 492 |
– |
mo_modrestart(struct Client *client_p, struct Client *source_p, |
| 493 |
– |
int parc, char *parv[]) |
| 494 |
– |
{ |
| 495 |
– |
unsigned int modnum = 0; |
| 496 |
– |
dlink_node *ptr = NULL, *ptr_next = NULL; |
| 497 |
– |
|
| 498 |
– |
if (!HasOFlag(source_p, OPER_FLAG_MODULE)) |
| 499 |
– |
{ |
| 500 |
– |
sendto_one(source_p, form_str(ERR_NOPRIVILEGES), |
| 501 |
– |
me.name, source_p->name); |
| 502 |
– |
return; |
| 503 |
– |
} |
| 504 |
– |
|
| 505 |
– |
sendto_one(source_p, ":%s NOTICE %s :Reloading all modules", |
| 506 |
– |
me.name, source_p->name); |
| 507 |
– |
|
| 508 |
– |
modnum = dlink_list_length(&mod_list); |
| 509 |
– |
|
| 510 |
– |
DLINK_FOREACH_SAFE(ptr, ptr_next, mod_list.head) |
| 511 |
– |
{ |
| 512 |
– |
struct module *modp = ptr->data; |
| 513 |
– |
unload_one_module(modp->name, 0); |
| 514 |
– |
} |
| 515 |
– |
|
| 516 |
– |
load_all_modules(0); |
| 517 |
– |
load_conf_modules(); |
| 518 |
– |
load_core_modules(0); |
| 519 |
– |
|
| 520 |
– |
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 521 |
– |
"Module Restart: %u modules unloaded, %u modules loaded", |
| 522 |
– |
modnum, dlink_list_length(&mod_list)); |
| 523 |
– |
ilog(L_WARN, "Module Restart: %u modules unloaded, %u modules loaded", |
| 524 |
– |
modnum, dlink_list_length(&mod_list)); |
| 525 |
– |
} |