summaryrefslogtreecommitdiffstats
path: root/lib/pid_output.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve writing of pid lock file and error reporting.Chris Hall2011-05-181-34/+58
| | | | | | | | | | | | | Added fsync() after writing the pid to the lock file to push the result to the file system immediately. Any error in the procedure is now treated as fatal, and the daemon will exit(1). (Previously only the open and the lock had to succeed.) Any error is logged and is (now) output to stderr. If the pid file is locked, the error message reports the pid which owns the lock.
* New functions for error numbers and addresses in messages.Chris Hall2010-04-081-7/+7
| | | | | | | | Implemented less onerous ways of including descriptions of errors and IP addresses in logging and other messages. Implemented mapping of error numbers to error names, which is generally more meaningful.
* + pidfiles are now always created with 0644 perms instead if LOGFILE_MASK (0600)Denis Ovsienko2007-10-041-3/+4
|
* 2004-12-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-12-171-19/+21
| | | | | | | | * pid_output.c: (pid_output_lock) Eliminate static function, and just use the #ifdef to decide which version of the function to include. This eliminates a compilation problem with gcc4. And fix the non-fcntl version so that it actually compiles. Exit with status 1 instead of -1 on error.
* 2004-12-03 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-12-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_main.c: (sigint) Use zlog_notice for termination message. (main) Use zlog_notice for startup announcement. * isis_main.c: (sigint,sigterm) Use zlog_notice for termination message. (terminate) This function should be static, not global. (main) Use zlog_notice for startup announcement, and remove ifdef ZEBRA_VERSION. * version.h.in: Remove declaration for pid_output_lock, this function is now static, not global. * pid_output.c: (pid_output_lock) This function should be static, not global. And remove "old umask" error message, since it was really an unimportant debug message, not an error. (pid_output) Need to declare static function pid_output_lock. * ospf6_main.c: (sigint,sigterm) Use zlog_notice for termination message. (main) Remove commented-out call to pid_output_lock (which should never be called other than from inside pid_output). And use zlog_notice to print the startup message, which now includes the vty port. * ospf_main.c: (sigint) Use zlog_notice for termination message. (main) Issue a startup announcement using zlog_notice. * rip_main.c: (sigint) Use zlog_notice for termination message. (main) Add a startup announcement using zlog_notice. * ripng_main.c: (sighup) Remove spurious terminating message. (sigint) Use zlog_notice for termination message. (main) Issue a startup announcement using zlog_notice. * main.c: (sigint) Use zlog_notice for termination message. (main) Add a startup announcement using zlog_notice.
* 2004-11-25 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-11-251-4/+11
| | | | | | | * pid_output.c: (pid_output_lock) Fix 2 bugs: when locking, should set l_whence to SEEK_SET, not SEEK_END. And after writing new pid to file, must ftruncate to eliminate any extraneous bytes left over from the last time a pid was written.
* 2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-11-201-1/+1
| | | | | * global: Replace strerror with safe_strerror. And vtysh/vtysh.c needs to include "log.h" to pick up the declaration.
* Make more strings const.hasso2004-10-071-3/+3
|
* 2003-12-22 Christian Hammers <ch@lathspell.de>gdt2003-12-221-1/+10
| | | | | | * configure.ac (and everywhere a regular file is opened for writing): use file permissions from configure rather than compiled-in umask.
* 2003-10-30 sowmini.varadhan@sun.compaul2003-10-301-2/+4
| | | | * lib/pid_output.c: (pid_output_lock) undo paulj's mindless edit.
* 2003-10-24 sowmini.varadhan@sun.compaul2003-10-241-15/+24
| | | | | | | * lib/pid_output.c: (pid_output) call pid_output_lock if we have fcntl(). (pid_output_lock) grab exclusive write lock on pid file, rather than rely on (fragile) exclusive create.
* Initial revisionpaul2002-12-131-0/+77