protect_db.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. /* Header file for protect_db.c */
  42. int add_new_slapd_process(int exec_mode, int r_flag, int skip_flag);
  43. int is_slapd_running();
  44. void remove_slapd_process();
  45. /*
  46. * These are the format strings used in the error messages in protect_db.c.
  47. * After each string is a short description of what gets inserted into the
  48. * string.
  49. */
  50. #define ERROR_ACCESSING_LOCKFILE "Error - Problem accessing the lockfile %s\n"
  51. /* name of lockfile */
  52. #define LOCKFILE_DEAD_OWNER "Error - The lockfile, %s, is held by process %d,\nwhich no longer seems to be running. If this is\nthe case, please remove the lockfile\n"
  53. /* name of lockfile, pid of owning process */
  54. #define UNABLE_TO_GET_LOCKFILE "Error - Unable to acquire the lockfile, %s.\nPlease make sure no instances of the ns-slapd process are running, remove the lockfile and try again\n"
  55. /* name of lockfile */
  56. #define LOCKFILE_ALREADY_OWNED "Error - Unable to start because process %d holds a lock.\nPlease make sure that the process is running correctly\nIf it is not, kill it and try again.\n"
  57. /* pid of owning process */
  58. #define FILE_CREATE_ERROR "Error - Unable to create %s, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n"
  59. /* name of file */
  60. #define FILE_CREATE_WARNING "Warning - Unable to create %s\n"
  61. /* name of file */
  62. #define GETPWNAM_WARNING "Warning - Unable to find user %s in system account database, errno %d (%s)\n"
  63. /* user name, error code, error message */
  64. #define CHOWN_WARNING "Warning - couldn't set the ownership for %s\n"
  65. /* file name */
  66. #define NO_SERVER_DUE_TO_SERVER "Unable to start slapd because it is already running as process %d\n"
  67. /* pid of running slapd process */
  68. #define NO_SERVER_DUE_TO_IMPORT "Unable to start slapd because a database is being imported by process %d\n"
  69. /* pid of importing process */
  70. #define NO_SERVER_DUE_TO_USE "Unable to start slapd because the database is in use\nby another slapd process\n"
  71. #define NO_DB2LDIFR_DUE_TO_USE "Unable to run db2ldif with the -r flag because the database is being used by another slapd process.\n"
  72. #define NO_DB2LDIF_DUE_TO_IMPORT "Unable to run db2ldif because the process %d is importing the database.\n"
  73. /* pid of importing process */
  74. #define NO_DB2BAK_DUE_TO_IMPORT "Unable to run db2bak because the process %d is importing the database.\n"
  75. /* pid of importing process */
  76. #define NO_EXPORT_DUE_TO_IMPORT "Unable to export the database because it is being imported.\n"
  77. #define NO_IMPORT_DUE_TO_USE "Unable to import the database because it is being used by another slapd process.\n"
  78. #define NO_DBTEST_DUE_TO_USE "Unable to test the database because it is being used by another slapd process.\n"
  79. #define NO_DB2INDEX_DUE_TO_USE "Unable to create an index because the database is being used by another slapd process.\n"
  80. #define NO_UPGRADEDB_DUE_TO_USE "Unable to recreate index files because the database is being used by another slapd process.\n"
  81. #define CREATE_MUTEX_ERROR "Error - CreateMutex failed: %s\n"
  82. /* reason for failure */
  83. #define WAIT_ERROR "Error - wait failed: %s\n"
  84. /* reason for failure */