PennMUSH Community

Changeset 954

Show
Ignore:
Timestamp:
06/17/07 23:09:40 (1 year ago)
Author:
shawnw
Message:

New --pid-file option to netmud to specify where to save its pid. restart now uses it. Document --no-session in game/README. Make @shutdown/reboot use it. csrimalloc cleanup from 1.8.2. (Maybe now it won't get changed every time I run make indent?)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/branches/devel/game/README

    r515 r954  
    44PennMUSH as described in the main PennMUSH README file. 
    55 
    6 The next step is to create your configuration file. In the game directory 
    7 is a file called "mush.cnf". If you don't have mush.cnf, but you have 
    8 mushcnf.dst, you can copy mushcnf.dst to mush.cnf.  This file is a list 
    9 of all runtime configuration options with their default settting. Change 
    10 them as you see fit.  IMPORTANT: do not _delete_ any parameters. The
    11 all need to be there. 
     6The next step is to create your configuration file. In the game 
     7directory is a file called "mush.cnf". If you don't have mush.cnf, but 
     8you have mushcnf.dst, you can copy mushcnf.dst to mush.cnf.  This file 
     9is a list of all runtime configuration options with their default 
     10settting. Change them as you see fit.  IMPORTANT: do not _delete_ an
     11parameters. They all need to be there. 
    1212 
    1313WIN32 WITH MSVC++: 
     
    2121  containing mush.cnf. Read about the optional settings in that file. 
    2222  The restart script is written for sh, and assumes a fairly standard 
    23   Berkeley UNIX setup. If you're on a HP-UX or SysV machine, for example, 
    24   you may need to change the restart script a bit (the ps options, 
    25   for example). Then run it
     23  Berkeley UNIX setup. If you're on a HP-UX or SysV machine, for 
     24  example, you may need to change the restart script a bit. Then run 
     25  it, with 'sh restart' or './restart'
    2626 
    27 You should now be ready to start the game.  This distribution can 
     27You should now be able to log into the game.  This distribution can 
    2828general a minimal database - a God character, starting room, and 
    2929master room.  The server will generate this database if it doesn't 
     
    3232If you're starting with the minimal database, the god character "One" 
    3333has no password, so you can log in without one. Of course, you should 
    34 immediately set one (via @newpasswd).  options.h has the Master Room as 
    35 #2 by default; in the minimal database, this room is created for you. 
     34immediately set one (via @newpasswd).  options.h has the Master Room 
     35as #2 by default; in the minimal database, this room is created for 
     36you. 
    3637 
    37 Now you should be set -- all you have to do now is customize the 
    38 .txt files in the game directory. 
     38Now you should be set -- all you have to do now is customize the .txt 
     39files in the game directory. 
    3940 
    4041The logfiles in the "log" directory generally contain useful 
    41 information. You will probably want to read your error logfile (defined 
    42 in mush.cnf) every time, since errors and other important messages ge
    43 printed to that logfile. 
     42information. You will probably want to read your error logfile 
     43(defined in mush.cnf) every time, since errors and other importan
     44messages get printed to that logfile. 
    4445 
    45 After your first startup, it's a good idea to make some small 
    46 change to the database (e.g., @create an object) and then 
    47 do an @shutdown. Restart the game again and ensure that your 
    48 object is still present - this verifies that the server is 
    49 successfully dumping. 
     46After your first startup, it's a good idea to make some small change 
     47to the database (e.g., @create an object) and then do an 
     48@shutdown. Restart the game again and ensure that your object is still 
     49present - this verifies that the server is successfully dumping. 
    5050 
    5151============================================================================ 
     
    7575 
    7676To attempt to fix the problem, do a @dbck to take care of any possible 
    77 minor weirdness in the database, then try doing a "@dump/paranoid", and 
    78 reading the checkpoint logfile (default is log/checkpt.log). This is 
    79 slow, but it will write out an uncorrupted database, and tell you what 
    80 it fixed. Back up that database and indb.Z, then figure out what you're 
    81 going to do next: you can take the game down with a kill -9, or attempt 
    82 to manually fix the problem by either @destroying the offending object, 
    83 or attempting to reset the attributes on the object that are causing a 
    84 problem.  If "@dump/paranoid" dies, you are more or less out of luck. 
     77minor weirdness in the database, then try doing a "@dump/paranoid", 
     78and reading the checkpoint logfile (default is log/checkpt.log). This 
     79is slow, but it will write out an uncorrupted database, and tell you 
     80what it fixed. Back up that database and indb.Z, then figure out what 
     81you're going to do next: you can take the game down with a kill -9, or 
     82attempt to manually fix the problem by either @destroying the 
     83offending object, or attempting to reset the attributes on the object 
     84that are causing a problem.  If "@dump/paranoid" dies, you are more or 
     85less out of luck. 
    8586 
    8687The game may crash from time to time. It will generate a core file, 
     
    9192your source code, and type 
    9293    <name of debugger> netmud ../game/core 
    93 If you don't call your executable "netmud", substitute in whatever  
    94 you do call it. 
     94If you don't call your executable "netmud", substitute in whatever you 
     95do call it. 
    9596 
    9697You are looking for variables set to bizarre values - attempts to 
     
    109110name>" to see the value of a variable at the time the game crashed. 
    110111The "gdb" debugger is similar to "dbx"; with that, you can abbreviate 
    111 "print" as "p". 
     112"print" as "p". It is the reccomended debugger to use; when gdb is 
     113present on your system and you're using gcc as the compiler, gcc is 
     114told to use a gdb-specific debugging format. 
    112115 
    113 Javelin appreciates news of any bugs found, and any patches that have 
    114 been written to deal with them. He is also interested in any extensions 
    115 that people make to the code, and requests that ones that are of more 
    116 than just local interest be sent to him for inclusion in the next 
    117 release of this code. 
     116If you want to start PennMUSH running under a debugger, instead of 
     117attaching to an already-running process, it'll need two arguments: 
     118--no-session, and the name of your config file if it is different than 
     119mush.cnf. Without --no-session, the server will immediately fork off a 
     120detatched child process, and the debugger will tell you that the 
     121process exited normally.. 
    118122 
    119 One important thing to remember is, if the MUSH refuses to start, there 
    120 is probably a good reason. Check the MUSH log, and the core file, if 
    121 there is one. Make sure to back up your database before attempting to 
    122 restart -- remember that every time it restarts, it overwrites 
    123 indb.Z.old. If you restart three times and somehow manage to trash your 
    124 database each time (for example, a full process table zero'ing out your 
    125 files), you won't have a backup to restart from, unless you've backed 
    126 up your database before trying! 
     123The PennMUSH developers appreciate news of any bugs found, and any 
     124patches that have been written to deal with them. We are also 
     125interested in any extensions that people make to the code, and 
     126requests that ones that are of more than just local interest be sent 
     127to us for inclusion in the next release of this code. See 
     128http://dev.pennmush.org. 
     129 
     130One important thing to remember is, if the MUSH refuses to start, 
     131there is probably a good reason. Check the MUSH log, and the core 
     132file, if there is one. Make sure to back up your database before 
     133attempting to restart -- remember that every time it restarts, it 
     134overwrites indb.Z.old. If you restart three times and somehow manage 
     135to trash your database each time (for example, a full process table 
     136zero'ing out your files), you won't have a backup to restart from, 
     137unless you've backed up your database before trying! 
    127138 
    128139You can also find helpful tips in Javelin's Guide for Gods, 
    129140which is available on the WWW as 
    130     http://pennmush.org/~alansz/guide.html 
    131 and by ftp from pennmush.org as  
    132     /pub/DuneMUSH/Guide/guide-single.txt 
     141    http://javelin.pennmush.org/~alansz/guide.html 
     142and by ftp from ftp.pennmush.org as  
     143    /PennMUSH/Guide/guide-single.txt 
    133144 
  • 1.8.3/branches/devel/game/restart

    r694 r954  
    88 
    99# OPTIONAL things that you may want to tweak. 
     10 
     11# Name of file to write the game's process id to. Used by restart to 
     12# check for an already running game. 
     13PIDFILE=netmush.pid 
    1014 
    1115# Uncomment the line below to attempt to allow crashes to produce 
     
    8690# Prevent double-starting things. You may need to provide a pathname for 
    8791#  some of the commands. System V flavors need "ps -f" instead of "ps uwx". 
    88 mush=`ps uwwx | grep " $GAMEDIR/$CONF_FILE" | grep -v grep | wc -l` 
    8992 
     93# Old style, look for a program using the config file.  
     94#mush=`ps uwwx | grep " $GAMEDIR/$CONF_FILE" | grep -v grep | wc -l` 
     95# if [ "$mush" -gt 0 ]; then 
    9096 
    91 if [ "$mush" -gt 0 ]; then 
     97# New style, look for a pid file. 
     98if [ -f $PIDFILE ]; then 
     99    foo=`kill -0 \`cat $PIDFILE\` 2>/dev/null` 
     100    mush=$? 
     101else 
     102    mush=1; 
     103fi 
     104 
     105if [ "$mush" -eq 0 ]; then 
    92106  echo Mush already active or some other process is using $GAMEDIR/$CONF_FILE. 
    93107  exit 0 
     
    141155export DATEMSK 
    142156 
    143 LC_ALL=$LANG LANG=$LANG ./netmush $GAMEDIR/$CONF_FILE & 
     157LC_ALL=$LANG LANG=$LANG ./netmush $@ $GAMEDIR/$CONF_FILE & 
  • 1.8.3/branches/devel/hdrs/csrimalloc.h

    r905 r954  
    2222/* Tracing malloc definitions - helps find leaks */ 
    2323 
    24 extern univptr_t trace__malloc 
    25 _((size_t nbytes, const char *fname, int linenum)); 
    26 extern univptr_t trace__calloc 
    27 _((size_t nelem, size_t elsize, const char *fname, int linenum)); 
    28 extern univptr_t trace__realloc 
    29 _((univptr_t cp, size_t nbytes, const char *fname, int linenum)); 
    30 extern univptr_t trace__valloc _((size_t size, const char *fname, int linenum)); 
    31 extern univptr_t trace__memalign 
    32 _((size_t alignment, size_t size, const char *fname, int linenum)); 
    33 extern univptr_t trace__emalloc 
    34 _((size_t nbytes, const char *fname, int linenum)); 
    35 extern univptr_t trace__ecalloc 
    36 _((size_t nelem, size_t sz, const char *fname, int linenum)); 
    37 extern univptr_t trace__erealloc 
    38 _((univptr_t ptr, size_t nbytes, const char *fname, int linenum)); 
    39 extern char *trace__strdup _((const char *s, const char *fname, int linenum)); 
    40 extern char *trace__strsave _((const char *s, const char *fname, int linenum)); 
    41 extern void trace__free _((univptr_t cp, const char *fname, int linenum)); 
    42 extern void trace__cfree _((univptr_t cp, const char *fname, int linenum)); 
     24univptr_t trace__malloc(size_t nbytes, const char *fname, int linenum); 
     25univptr_t trace__calloc 
     26  (size_t nelem, size_t elsize, const char *fname, int linenum); 
     27univptr_t trace__realloc 
     28  (univptr_t cp, size_t nbytes, const char *fname, int linenum); 
     29univptr_t trace__valloc(size_t size, const char *fname, int linenum); 
     30univptr_t trace__memalign 
     31  (size_t alignment, size_t size, const char *fname, int linenum); 
     32univptr_t trace__emalloc(size_t nbytes, const char *fname, int linenum); 
     33univptr_t trace__ecalloc 
     34  (size_t nelem, size_t sz, const char *fname, int linenum); 
     35univptr_t trace__erealloc 
     36  (univptr_t ptr, size_t nbytes, const char *fname, int linenum); 
     37char *trace__strdup(const char *s, const char *fname, int linenum); 
     38char *trace__strsave(const char *s, const char *fname, int linenum); 
     39void trace__free(univptr_t cp, const char *fname, int linenum); 
     40void trace__cfree(univptr_t cp, const char *fname, int linenum); 
    4341 
    4442#define malloc(x)               trace__malloc((x), __FILE__, __LINE__) 
     
    5856#else                           /* CSRI_TRACE */ 
    5957 
    60 extern univptr_t malloc _((size_t nbytes)); 
    61 extern univptr_t calloc _((size_t nelem, size_t elsize)); 
    62 extern univptr_t realloc _((univptr_t cp, size_t nbytes)); 
    63 extern univptr_t valloc _((size_t size)); 
    64 extern univptr_t memalign _((size_t alignment, size_t size)); 
    65 extern univptr_t emalloc _((size_t nbytes)); 
    66 extern univptr_t ecalloc _((size_t nelem, size_t sz)); 
    67 extern univptr_t erealloc _((univptr_t ptr, size_t nbytes)); 
    68 extern char *strdup _((const char *s)); 
    69 extern char *strsave _((const char *s)); 
    70 extern Free_t free _((univptr_t cp)); 
    71 extern Free_t cfree _((univptr_t cp)); 
     58univptr_t malloc(size_t nbytes); 
     59univptr_t calloc(size_t nelem, size_t elsize); 
     60univptr_t realloc(univptr_t cp, size_t nbytes); 
     61univptr_t valloc(size_t size); 
     62univptr_t memalign(size_t alignment, size_t size); 
     63univptr_t emalloc(size_t nbytes); 
     64univptr_t ecalloc(size_t nelem, size_t sz); 
     65univptr_t erealloc(univptr_t ptr, size_t nbytes); 
     66char *strdup(const char *s); 
     67char *strsave(const char *s); 
     68void free(univptr_t cp); 
     69void cfree(univptr_t cp); 
    7270 
    7371#endif                          /* CSRI_TRACE */ 
    7472 
    75 extern void mal_debug _((int level)); 
    76 extern void mal_dumpleaktrace _((FILE * fp)); 
    77 extern void mal_heapdump _((FILE * fp)); 
    78 extern void mal_leaktrace _((int value)); 
    79 extern void mal_sbrkset _((int n)); 
    80 extern void mal_slopset _((int n)); 
    81 extern void mal_statsdump _((FILE * fp)); 
    82 extern void mal_setstatsfile _((FILE * fp)); 
    83 extern void mal_trace _((int value)); 
    84 extern int mal_verify _((int fullcheck)); 
    85 extern void mal_mmap _((char *fname)); 
     73void mal_debug(int level); 
     74void mal_dumpleaktrace(FILE * fp); 
     75void mal_heapdump(FILE * fp); 
     76void mal_leaktrace(int value); 
     77void mal_sbrkset(int n); 
     78void mal_slopset(int n); 
     79void mal_statsdump(FILE * fp); 
     80void mal_setstatsfile(FILE * fp); 
     81void mal_trace(int value); 
     82int mal_verify(int fullcheck); 
     83void mal_mmap(char *fname); 
    8684 
    8785 
  • 1.8.3/branches/devel/src/bsd.c

    r952 r954  
    378378void load_reboot_db(void); 
    379379 
    380 static int in_suid_root_mode = 0; 
     380static bool in_suid_root_mode = 0; 
     381static char *pidfile = NULL; 
     382static char **saved_argv = NULL; 
    381383 
    382384#ifndef BOOLEXP_DEBUGGING 
     
    397399#endif                          /* WIN32SERVICES */ 
    398400{ 
    399 #ifdef AUTORESTART 
    400   FILE *id; 
    401 #endif 
    402401  FILE *newerr; 
     402  int logfile_pos = -1; 
    403403  bool detach_session = 1; 
    404   int logfile_pos; 
    405404 
    406405/* disallow running as root on unix. 
     
    440439        if (strcmp(argv[n], "--no-session") == 0) 
    441440          detach_session = 0; 
    442         else 
    443           fprintf(stderr, "Unknown option \"%s\"\n", argv[n]); 
     441        else if (strncmp(argv[n], "--pid-file", 10) == 0) { 
     442          char *eq; 
     443          if ((eq = strchr(argv[n], '='))) 
     444            pidfile = eq + 1; 
     445          else { 
     446            if (n + 1 >= argc) { 
     447              fprintf(stderr, "%s: --pid-file needs a filename.\n", argv[0]); 
     448              return EXIT_FAILURE; 
     449            } 
     450            pidfile = argv[n + 1]; 
     451            n++; 
     452          } 
     453        } else 
     454          fprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], argv[n]); 
    444455      } else { 
    445456        mush_strncpy(confname, argv[n], BUFFER_LEN); 
     
    470481  } 
    471482#endif 
     483 
     484#ifdef HAVE_GETPID 
     485  if (pidfile) { 
     486    FILE *f; 
     487    if (!(f = fopen(pidfile, "w"))) { 
     488      fprintf(stderr, "%s: Unable to write to pidfile '%s'\n", argv[0], 
     489              pidfile); 
     490      return EXIT_FAILURE; 
     491    } 
     492    fprintf(f, "%d\n", getpid()); 
     493    fclose(f); 
     494  } 
     495#endif 
     496 
     497  saved_argv = argv; 
    472498 
    473499#ifdef WIN32 
     
    539565  tables = pcre_maketables(); 
    540566 
    541 /* this writes a file used by the restart script to check for active mush */ 
    542 #ifdef AUTORESTART 
    543   id = fopen("runid", "w"); 
    544   fprintf(id, "%d", getpid()); 
    545   fclose(id); 
    546 #endif 
    547  
    548567  init_game_config(confname); 
    549568 
     
    625644 
    626645  end_all_logs(); 
     646 
     647  if (pidfile) 
     648    remove(pidfile); 
    627649 
    628650#ifdef CSRI 
     
    921943      flag_broadcast(0, 0, T("GAME: Shutdown by external signal")); 
    922944      do_rawlog(LT_ERR, T("SHUTDOWN by external signal")); 
    923 #ifdef AUTORESTART 
    924       system("touch NORESTART"); 
    925 #endif 
    926945      shutdown_flag = 1; 
    927946    } 
     
    45474566  flag_broadcast(0, 0, T("GAME: Reboot finished.")); 
    45484567} 
     4568 
     4569/** Reboot the game without disconnecting players. 
     4570 * \verbatim 
     4571 * This implements @shutdown/reboot, which performs a dump, saves 
     4572 * information about which player is associated with which socket, 
     4573 * and then re-execs the mush process without closing the sockets. 
     4574 * \endverbatim 
     4575 * \param player the enactor. 
     4576 * \param flag if 0, normal dump; if 1, paranoid dump. 
     4577 */ 
     4578void 
     4579do_reboot(dbref player, int flag) 
     4580{ 
     4581  if (player == NOTHING) { 
     4582    flag_broadcast(0, 0, 
     4583                   T 
     4584                   ("GAME: Reboot w/o disconnect from game account, please wait.")); 
     4585  } else { 
     4586    flag_broadcast(0, 0, 
     4587                   T 
     4588                   ("GAME: Reboot w/o disconnect by %s, please wait."), 
     4589                   Name(Owner(player))); 
     4590  } 
     4591  if (flag) { 
     4592    globals.paranoid_dump = 1; 
     4593    globals.paranoid_checkpt = db_top / 5; 
     4594    if (globals.paranoid_checkpt < 1) 
     4595      globals.paranoid_checkpt = 1; 
     4596  } 
     4597#ifdef HAS_OPENSSL 
     4598  close_ssl_connections(); 
     4599#endif 
     4600  sql_shutdown(); 
     4601  shutdown_queues(); 
     4602  fork_and_dump(0); 
     4603#ifndef PROFILING 
     4604#ifndef WIN32 
     4605  /* Some broken libcs appear to retain the itimer across exec! 
     4606   * So we make sure that if we get a SIGPROF in our next incarnation, 
     4607   * we ignore it until our proper handler is set up. 
     4608   */ 
     4609  ignore_signal(SIGPROF); 
     4610#endif 
     4611#endif 
     4612  dump_reboot_db(); 
     4613#ifdef INFO_SLAVE 
     4614  kill_info_slave(); 
     4615#endif 
     4616  local_shutdown(); 
     4617  end_all_logs(); 
     4618#ifndef WIN32 
     4619  { 
     4620    char *args[6]; 
     4621 
     4622    args[0] = saved_argv[0]; 
     4623    args[1] = "--no-session"; 
     4624    args[2] = "--pid-file"; 
     4625    args[3] = pidfile; 
     4626    args[4] = confname; 
     4627    args[5] = NULL; 
     4628 
     4629    execv(saved_argv[0], args); 
     4630  } 
     4631#else 
     4632  execl("pennmush.exe", "pennmush.exe", "/run", NULL); 
     4633#endif                          /* WIN32 */ 
     4634  exit(1);                      /* Shouldn't ever get here, but just in case... */ 
     4635} 
  • 1.8.3/branches/devel/src/csrimalloc.c

    r952 r954  
    3838#undef cfree(p) 
    3939#undef free(p) 
    40 extern char *strdup _((const char *)); 
     40extern char *strdup(const char *); 
    4141#endif 
    4242 
     
    970970#ifdef CSRI_TRACE 
    971971/* Tracing malloc definitions - helps find leaks */ 
    972     univptr_t 
    973       trace__malloc 
    974     _((size_t nbytes, const char *fname, int linenum)); 
    975     univptr_t 
    976       trace__calloc 
    977     _((size_t nelem, size_t elsize, const char *fname, int linenum)); 
    978     univptr_t 
    979       trace__realloc 
    980     _((univptr_t cp, size_t nbytes, const char *fname, int linenum)); 
    981     univptr_t trace__valloc 
    982     _((size_t size, const char *fname, int linenum)); 
    983     univptr_t 
    984       trace__memalign 
    985     _((size_t alignment, size_t size, const char *fname, int linenum)); 
    986     univptr_t trace__emalloc 
    987     _((size_t nbytes, const char *fname, int linenum)); 
    988972univptr_t 
    989   trace__ecalloc _((size_t nelem, size_t sz, const char *fname, int linenum)); 
    990 univptr_t trace__erealloc 
    991 _((univptr_t ptr, size_t nbytes, const char *fname, int linenum)); 
    992     char *trace__strdup _((const char *s, const char *fname, int linenum)); 
    993     char *trace__strsave _((const char *s, const char *fname, int linenum)); 
     973trace__malloc(size_t nbytes, const char *fname, int linenum); 
     974univptr_t 
     975trace__calloc(size_t nelem, size_t elsize, const char *fname, int linenum); 
     976univptr_t 
     977trace__realloc(univptr_t cp, size_t nbytes, const char *fname, int linenum); 
     978univptr_t 
     979trace__valloc(size_t size, const char *fname, int linenum); 
     980univptr_t 
     981  trace__memalign 
     982  (size_t alignment, size_t size, const char *fname, int linenum); 
     983univptr_t 
     984trace__emalloc(size_t nbytes, const char *fname, int linenum); 
     985univptr_t 
     986trace__ecalloc(size_t nelem, size_t sz, const char *fname, int linenum); 
     987univptr_t 
     988trace__erealloc(univptr_t ptr, size_t nbytes, const char *fname, int linenum); 
     989    char *trace__strdup(const char *s, const char *fname, int linenum); 
     990    char *trace__strsave(const char *s, const char *fname, int linenum); 
    994991    void 
    995      trace__free _((univptr_t cp, const char *fname, int linenum)); 
     992     trace__free(univptr_t cp, const char *fname, int linenum); 
    996993    void 
    997      trace__cfree _((univptr_t cp, const char *fname, int linenum)); 
     994     trace__cfree(univptr_t cp, const char *fname, int linenum); 
    998995#else                           /* CSRI_TRACE */ 
    999     univptr_t 
    1000       malloc 
    1001     _((size_t nbytes)); 
    1002     univptr_t 
    1003       calloc 
    1004     _((size_t nelem, size_t elsize)); 
    1005     univptr_t 
    1006       realloc 
    1007     _((univptr_t cp, size_t nbytes)); 
    1008     univptr_t 
    1009       valloc 
    1010     _((size_t size)); 
    1011     univptr_t 
    1012       memalign 
    1013     _((size_t alignment, size_t size)); 
    1014     univptr_t 
    1015       emalloc 
    1016     _((size_t nbytes)); 
    1017     univptr_t 
    1018       ecalloc 
    1019     _((size_t nelem, size_t sz)); 
    1020     univptr_t 
    1021       erealloc 
    1022     _((univptr_t ptr, size_t nbytes)); 
    1023     Free_t free 
    1024     _((univptr_t cp)); 
    1025     Free_t cfree 
    1026     _((univptr_t cp)); 
     996univptr_t 
     997malloc(size_t nbytes); 
     998univptr_t 
     999calloc(size_t nelem, size_t elsize); 
     1000univptr_t 
     1001realloc(univptr_t cp, size_t nbytes); 
     1002univptr_t 
     1003valloc(size_t size); 
     1004univptr_t 
     1005memalign(size_t alignment, size_t size); 
     1006univptr_t 
     1007emalloc(size_t nbytes); 
     1008univptr_t 
     1009ecalloc(size_t nelem, size_t sz); 
     1010univptr_t 
     1011erealloc(univptr_t ptr, size_t nbytes); 
     1012Free_t 
     1013free(univptr_t cp); 
     1014Free_t 
     1015cfree(univptr_t cp); 
    10271016#endif                          /* CSRI_TRACE */ 
    10281017 
    10291018    int 
    1030       __m_botch 
    1031     _((const char *s1, const char *s2, univptr_t p, 
    1032        int is_end_ptr, const char *filename, int linenumber))
     1019     __m_botch 
     1020      (const char *s1, const char *s2, univptr_t p, 
     1021       int is_end_ptr, const char *filename, int linenumber)
    10331022    void 
    1034     __m_prnode 
    1035     _((SPBLK * spblk)); 
     1023     __m_prnode(SPBLK * spblk); 
    10361024    void 
    1037     mal_contents 
    1038     _((FILE * fp)); 
     1025     mal_contents(FILE * fp); 
    10391026#ifdef CSRI_DEBUG 
    10401027    void 
    1041     mal_debug 
    1042     _((int level)); 
     1028     mal_debug(int level); 
    10431029    int 
    1044     mal_verify 
    1045     _((int fullcheck)); 
     1030     mal_verify(int fullcheck); 
    10461031#endif 
    10471032    void 
    1048     mal_dumpleaktrace 
    1049     _((FILE * fp)); 
     1033     mal_dumpleaktrace(FILE * fp); 
    10501034    void 
    1051     mal_heapdump 
    1052     _((FILE * fp)); 
     1035     mal_heapdump(FILE * fp); 
    10531036    void 
    1054     mal_leaktrace 
    1055     _((int value)); 
     1037     mal_leaktrace(int value); 
    10561038    void 
    1057     mal_sbrkset 
    1058     _((int n)); 
     1039     mal_sbrkset(int n); 
    10591040    void 
    1060     mal_slopset 
    1061     _((int n)); 
     1041     mal_slopset(int n); 
    10621042#ifdef CSRI_PROFILESIZES 
    10631043    void 
    1064     mal_statsdump 
    1065     _((FILE * fp)); 
     1044     mal_statsdump(FILE * fp); 
    10661045#endif 
    10671046    void 
    1068     mal_trace 
    1069     _((int value)); 
     1047     mal_trace(int value); 
    10701048    void 
    1071     mal_mmap 
    1072     _((char *fname)); 
     1049     mal_mmap(char *fname); 
    10731050 
    10741051#ifdef CSRI_TRACE 
     
    17861763} 
    17871764 
    1788 static void __m_count _((SPBLK * spblk)); 
     1765static void __m_count(SPBLK * spblk); 
    17891766 
    17901767static void 
     
    19081885         } 
    19091886 
    1910 static int grabhunk _((size_t)); 
     1887static int grabhunk(size_t); 
    19111888 
    19121889static int 
  • 1.8.3/branches/devel/src/game.c

    r945 r954  
    287287    do_log(LT_ERR, player, NOTHING, T("SHUTDOWN by %s(%s)\n"), 
    288288           Name(player), unparse_dbref(player)); 
    289  
    290     /* This will create a file used to check if a restart should occur */ 
    291 #ifdef AUTORESTART 
    292     system("touch NORESTART"); 
    293 #endif 
    294289 
    295290    if (flag == SHUT_PANIC) { 
  • 1.8.3/branches/devel/src/wiz.c

    r918 r954  
    17291729} 
    17301730 
    1731  
    1732 /** Reboot the game without disconnecting players. 
    1733  * \verbatim 
    1734  * This implements @shutdown/reboot, which performs a dump, saves 
    1735  * information about which player is associated with which socket, 
    1736  * and then re-execs the mush process without closing the sockets. 
    1737  * \endverbatim 
    1738  * \param player the enactor. 
    1739  * \param flag if 0, normal dump; if 1, paranoid dump. 
    1740  */ 
    1741 void 
    1742 do_reboot(dbref player, int flag) 
    1743 { 
    1744   if (player == NOTHING) { 
    1745     flag_broadcast(0, 0, 
    1746                    T 
    1747                    ("GAME: Reboot w/o disconnect from game account, please wait.")); 
    1748   } else { 
    1749     flag_broadcast(0, 0, 
    1750                    T 
    1751                    ("GAME: Reboot w/o disconnect by %s, please wait."), 
    1752                    Name(Owner(player))); 
    1753   } 
    1754   if (flag) { 
    1755     globals.paranoid_dump = 1; 
    1756     globals.paranoid_checkpt = db_top / 5; 
    1757     if (globals.paranoid_checkpt < 1) 
    1758       globals.paranoid_checkpt = 1; 
    1759   } 
    1760 #ifdef HAS_OPENSSL 
    1761   close_ssl_connections(); 
    1762 #endif 
    1763   sql_shutdown(); 
    1764   shutdown_queues(); 
    1765   fork_and_dump(0); 
    1766 #ifndef PROFILING 
    1767 #ifndef WIN32 
    1768   /* Some broken libcs appear to retain the itimer across exec! 
    1769    * So we make sure that if we get a SIGPROF in our next incarnation, 
    1770    * we ignore it until our proper handler is set up. 
    1771    */ 
    1772   ignore_signal(SIGPROF); 
    1773 #endif 
    1774 #endif 
    1775   dump_reboot_db(); 
    1776 #ifdef INFO_SLAVE 
    1777   kill_info_slave(); 
    1778 #endif 
    1779   local_shutdown(); 
    1780   end_all_logs(); 
    1781 #ifndef WIN32 
    1782   execl("netmush", "netmush", confname, NULL); 
    1783 #else 
    1784   execl("pennmush.exe", "pennmush.exe", "/run", NULL); 
    1785 #endif                          /* WIN32 */ 
    1786   exit(1);                      /* Shouldn't ever get here, but just in case... */ 
    1787 } 
    1788  
    1789  
    17901731static int 
    17911732fill_search_spec(dbref player, const char *owner, int nargs, const char **args,