1 | /* |
---|
2 | * $Id: log.h 52 2003-11-25 14:13:46Z bas $ |
---|
3 | * |
---|
4 | * OpenPBS (Portable Batch System) v2.3 Software License |
---|
5 | * |
---|
6 | * Copyright (c) 1999-2002 Veridian Information Solutions, Inc. |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * --------------------------------------------------------------------------- |
---|
10 | * For a license to use or redistribute the OpenPBS software under conditions |
---|
11 | * other than those described below, or to purchase support for this software, |
---|
12 | * please contact Veridian Systems, PBS Products Department ("Licensor") at: |
---|
13 | * |
---|
14 | * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org |
---|
15 | * 877 902-4PBS (US toll-free) |
---|
16 | * --------------------------------------------------------------------------- |
---|
17 | * |
---|
18 | * This license covers use of the OpenPBS v2.3 software (the "Software") at |
---|
19 | * your site or location, and, for certain users, redistribution of the |
---|
20 | * Software to other sites and locations. Use and redistribution of |
---|
21 | * OpenPBS v2.3 in source and binary forms, with or without modification, |
---|
22 | * are permitted provided that all of the following conditions are met. |
---|
23 | * After December 31, 2003, only conditions 3-6 must be met: |
---|
24 | * |
---|
25 | * 1. Commercial and/or non-commercial use of the Software is permitted |
---|
26 | * provided a current software registration is on file at www.OpenPBS.org. |
---|
27 | * If use of this software contributes to a publication, product, or |
---|
28 | * service, proper attribution must be given; see www.OpenPBS.org/credit.html |
---|
29 | * |
---|
30 | * 2. Redistribution in any form is only permitted for non-commercial, |
---|
31 | * non-profit purposes. There can be no charge for the Software or any |
---|
32 | * software incorporating the Software. Further, there can be no |
---|
33 | * expectation of revenue generated as a consequence of redistributing |
---|
34 | * the Software. |
---|
35 | * |
---|
36 | * 3. Any Redistribution of source code must retain the above copyright notice |
---|
37 | * and the acknowledgment contained in paragraph 6, this list of conditions |
---|
38 | * and the disclaimer contained in paragraph 7. |
---|
39 | * |
---|
40 | * 4. Any Redistribution in binary form must reproduce the above copyright |
---|
41 | * notice and the acknowledgment contained in paragraph 6, this list of |
---|
42 | * conditions and the disclaimer contained in paragraph 7 in the |
---|
43 | * documentation and/or other materials provided with the distribution. |
---|
44 | * |
---|
45 | * 5. Redistributions in any form must be accompanied by information on how to |
---|
46 | * obtain complete source code for the OpenPBS software and any |
---|
47 | * modifications and/or additions to the OpenPBS software. The source code |
---|
48 | * must either be included in the distribution or be available for no more |
---|
49 | * than the cost of distribution plus a nominal fee, and all modifications |
---|
50 | * and additions to the Software must be freely redistributable by any party |
---|
51 | * (including Licensor) without restriction. |
---|
52 | * |
---|
53 | * 6. All advertising materials mentioning features or use of the Software must |
---|
54 | * display the following acknowledgment: |
---|
55 | * |
---|
56 | * "This product includes software developed by NASA Ames Research Center, |
---|
57 | * Lawrence Livermore National Laboratory, and Veridian Information |
---|
58 | * Solutions, Inc. |
---|
59 | * Visit www.OpenPBS.org for OpenPBS software support, |
---|
60 | * products, and information." |
---|
61 | * |
---|
62 | * 7. DISCLAIMER OF WARRANTY |
---|
63 | * |
---|
64 | * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS |
---|
65 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
---|
66 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT |
---|
67 | * ARE EXPRESSLY DISCLAIMED. |
---|
68 | * |
---|
69 | * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE |
---|
70 | * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, |
---|
71 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
---|
72 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, |
---|
73 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
74 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
75 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
---|
76 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
77 | * |
---|
78 | * This license will be governed by the laws of the Commonwealth of Virginia, |
---|
79 | * without reference to its choice of law rules. |
---|
80 | */ |
---|
81 | |
---|
82 | /* |
---|
83 | * @(#) OpenPbs version: log.h,v 2.2.6.7 2001/12/05 00:38:11 hender Exp |
---|
84 | */ |
---|
85 | |
---|
86 | /* |
---|
87 | * include file for error/event logging |
---|
88 | */ |
---|
89 | |
---|
90 | /* |
---|
91 | * HvB: openpbs uses 1024 |
---|
92 | */ |
---|
93 | #define LOG_BUF_SIZE 4096 |
---|
94 | |
---|
95 | /* The following macro assist in sharing code between the Server and Mom */ |
---|
96 | #define LOG_EVENT log_event |
---|
97 | |
---|
98 | /* |
---|
99 | ** Set up a debug print macro. |
---|
100 | */ |
---|
101 | #ifdef DEBUG |
---|
102 | #define DBPRT(x) printf x; |
---|
103 | #else |
---|
104 | #define DBPRT(x) |
---|
105 | #endif |
---|
106 | |
---|
107 | extern long *log_event_mask; |
---|
108 | |
---|
109 | extern void log_close(int close_msg); |
---|
110 | extern void log_err(int err, char *func, char *text); |
---|
111 | extern void log_event(int type, int class_int, char *id, char *text); |
---|
112 | extern int log_open(char *name, char *directory); |
---|
113 | extern void log_record(int type, int class_int, char *id, char *text); |
---|
114 | extern char log_buffer[LOG_BUF_SIZE]; |
---|
115 | extern int setup_env(char *filename); |
---|
116 | |
---|
117 | /* HvB: Bas van der Vlies |
---|
118 | * Must be chk_file_sec |
---|
119 | extern int chk_path_sec(char *path, int dir, int sticky, int bad, int); |
---|
120 | */ |
---|
121 | extern int chk_file_sec(char *file, int dir, int sticky, int bad, int); |
---|
122 | |
---|
123 | /* Event types */ |
---|
124 | |
---|
125 | #define PBSEVENT_ERROR 0x0001 /* internal errors */ |
---|
126 | #define PBSEVENT_SYSTEM 0x0002 /* system (server) events */ |
---|
127 | #define PBSEVENT_ADMIN 0x0004 /* admin events */ |
---|
128 | #define PBSEVENT_JOB 0x0008 /* job related events */ |
---|
129 | #define PBSEVENT_JOB_USAGE 0x0010 /* End of Job accounting */ |
---|
130 | #define PBSEVENT_SECURITY 0x0020 /* security violation events */ |
---|
131 | #define PBSEVENT_SCHED 0x0040 /* scheduler events */ |
---|
132 | #define PBSEVENT_DEBUG 0x0080 /* common debug messages */ |
---|
133 | #define PBSEVENT_DEBUG2 0x0100 /* less needed debug messages */ |
---|
134 | #define PBSEVENT_FORCE 0x8000 /* set to force a messag */ |
---|
135 | |
---|
136 | /* Event Object Classes, see array class_names[] in ../lib/Liblog/pbs_log.c */ |
---|
137 | |
---|
138 | #define PBS_EVENTCLASS_SERVER 1 /* The server itself */ |
---|
139 | #define PBS_EVENTCLASS_QUEUE 2 /* Queues */ |
---|
140 | #define PBS_EVENTCLASS_JOB 3 /* Jobs */ |
---|
141 | #define PBS_EVENTCLASS_REQUEST 4 /* Batch Requests */ |
---|
142 | #define PBS_EVENTCLASS_FILE 5 /* A Job related File */ |
---|
143 | #define PBS_EVENTCLASS_ACCT 6 /* Accounting info */ |
---|
144 | #define PBS_EVENTCLASS_NODE 7 /* Nodes */ |
---|
145 | |
---|
146 | /* Logging Masks */ |
---|
147 | |
---|
148 | #define PBSEVENT_MASK 0x01ff |
---|
149 | |
---|
150 | /* HvB: |
---|
151 | * msg_daemonname is extern declared in liblog.a. So define it here |
---|
152 | */ |
---|
153 | char *msg_daemonname = "pbs_python"; |
---|