New post_crash_dump_hook
Run it from crash_dump(). Useful to move core files out of the way, alert deities by e-mail, and so forth.
This commit is contained in:
parent
dd0737f8e7
commit
f63401329d
5 changed files with 7 additions and 2 deletions
|
@ -90,6 +90,8 @@ EMPCFBOTH("port", loginport, char *, NSC_STRING, KM_INTERNAL,
|
|||
"TCP port the server will bind")
|
||||
EMPCFBOTH("keep_journal", keep_journal, int, NSC_INT, KM_INTERNAL,
|
||||
"Enable journal log file")
|
||||
EMPCFBOTH("post_crash_dump_hook", post_crash_dump_hook, char *, NSC_STRING, KM_INTERNAL,
|
||||
"Shell command run right after a crash dump, in the game's data directory")
|
||||
EMPCFBOTH("privname", privname, char *, NSC_STRING, 0,
|
||||
"Name of the deity")
|
||||
EMPCFBOTH("privlog", privlog, char *, NSC_STRING, 0,
|
||||
|
|
|
@ -49,6 +49,7 @@ void update_main(void);
|
|||
void update_init(void);
|
||||
int update_trigger(void);
|
||||
int update_reschedule(void);
|
||||
int run_hook(char *, char *);
|
||||
int shutdown_initiate(int);
|
||||
|
||||
/* thread entry points */
|
||||
|
|
|
@ -44,6 +44,8 @@ char *privlog = "careless@invalid";
|
|||
/* Divine hosts and networks */
|
||||
char *privip = "127.0.0.1 ::1 ::ffff:127.0.0.1";
|
||||
|
||||
char *post_crash_dump_hook = "";
|
||||
|
||||
char *disabled_commands = "";
|
||||
|
||||
int keep_journal = 0; /* journal log file enabled */
|
||||
|
|
|
@ -340,6 +340,7 @@ crash_dump(void)
|
|||
return;
|
||||
}
|
||||
}
|
||||
run_hook(post_crash_dump_hook, "post-crash-dump");
|
||||
logerror("Crash dump complete");
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -63,7 +63,6 @@ static empth_t *update_thread;
|
|||
static int update_get_schedule(void);
|
||||
static void update_sched(void *);
|
||||
static void update_run(void);
|
||||
static int run_hook(char *cmd, char *name);
|
||||
|
||||
void
|
||||
update_init(void)
|
||||
|
@ -218,7 +217,7 @@ update_run(void)
|
|||
empth_rwlock_unlock(play_lock);
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
run_hook(char *cmd, char *name)
|
||||
{
|
||||
int status;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue