111 |
char *pathname; |
char *pathname; |
112 |
int operator; |
int operator; |
113 |
int time; |
int time; |
114 |
|
int test_changes; |
115 |
int action; |
int action; |
116 |
}; |
}; |
117 |
|
|
182 |
static void check_every(int); |
static void check_every(int); |
183 |
static int check_perm(int); |
static int check_perm(int); |
184 |
static void check_hostname (char *); |
static void check_hostname (char *); |
185 |
|
static void check_exec(char *); |
186 |
static void createinfo(); |
static void createinfo(); |
187 |
static char *append_hostname(char *); |
static char *append_hostname(char *); |
188 |
static void cleanup_md5_string(char *); |
static void cleanup_md5_string(char *); |
216 |
%token AUTOSTART MODE ACTIVE PASSIVE MANUAL |
%token AUTOSTART MODE ACTIVE PASSIVE MANUAL |
217 |
%token GROUP REQUEST DEPENDS |
%token GROUP REQUEST DEPENDS |
218 |
%token UID GID ENVIRONMENT |
%token UID GID ENVIRONMENT |
219 |
%token TIMESTAMP SECOND MINUTE HOUR DAY |
%token TIMESTAMP CHANGED SECOND MINUTE HOUR DAY |
220 |
%token SSLAUTO SSLV2 SSLV3 TLSV1 |
%token SSLAUTO SSLV2 SSLV3 TLSV1 |
221 |
%token BYTE KILOBYTE MEGABYTE GIGABYTE |
%token BYTE KILOBYTE MEGABYTE GIGABYTE |
222 |
%token INODE SPACE PERM |
%token INODE SPACE PERM |
273 |
| depend |
| depend |
274 |
| resource resourcecycle action { |
| resource resourcecycle action { |
275 |
resourceset.action= $<number>3; |
resourceset.action= $<number>3; |
|
if((resourceset.action == ACTION_EXEC) && command) { |
|
|
command->events |= EVENT_RESOURCE; |
|
|
addcommand(EXEC); |
|
|
} |
|
276 |
addresource(&resourceset); |
addresource(&resourceset); |
277 |
} |
} |
278 |
; |
; |
750 |
timestampset.operator= $<number>3; |
timestampset.operator= $<number>3; |
751 |
timestampset.time= ($4 * $<number>5); |
timestampset.time= ($4 * $<number>5); |
752 |
timestampset.action= $<number>6; |
timestampset.action= $<number>6; |
753 |
if((timestampset.action == ACTION_EXEC) && command) { |
} |
754 |
command->events |= EVENT_TIMESTAMP; |
| TIMESTAMP PATH CHANGED action { |
755 |
addcommand(EXEC); |
timestampset.pathname= $2; |
756 |
} |
timestampset.test_changes= TRUE; |
757 |
|
timestampset.action= $<number>4; |
758 |
} |
} |
759 |
; |
; |
760 |
|
|
763 |
| LESS { $<number>$= OPERATOR_LESS; } |
| LESS { $<number>$= OPERATOR_LESS; } |
764 |
| EQUAL { $<number>$= OPERATOR_EQUAL; } |
| EQUAL { $<number>$= OPERATOR_EQUAL; } |
765 |
| NOTEQUAL { $<number>$= OPERATOR_NOTEQUAL; } |
| NOTEQUAL { $<number>$= OPERATOR_NOTEQUAL; } |
766 |
|
| CHANGED { $<number>$= OPERATOR_NOTEQUAL; } |
767 |
; |
; |
768 |
|
|
769 |
time : /* EMPTY */ { $<number>$= TIME_SECOND; } |
time : /* EMPTY */ { $<number>$= TIME_SECOND; } |
1178 |
|
|
1179 |
} |
} |
1180 |
|
|
1181 |
|
if((r->action == ACTION_EXEC) && command) { |
1182 |
|
r->exec= command; |
1183 |
|
command= NULL; |
1184 |
|
} |
1185 |
|
|
1186 |
current->resourcelist= r; |
current->resourcelist= r; |
1187 |
reset_resourceset(); |
reset_resourceset(); |
1188 |
|
|
1203 |
t->operator= ts->operator; |
t->operator= ts->operator; |
1204 |
t->time= ts->time; |
t->time= ts->time; |
1205 |
t->action= ts->action; |
t->action= ts->action; |
1206 |
|
t->test_changes= ts->test_changes; |
1207 |
|
|
1208 |
|
if(!exist_file(t->pathname)) { |
1209 |
|
|
1210 |
|
log("%s: The path '%s' used in the TIMESTAMP statement at line %d " |
1211 |
|
"does not exist\n", prog, t->pathname, lineno-1); |
1212 |
|
cfg_errflag++; |
1213 |
|
|
1214 |
|
} else if(!(t->timestamp= get_timestamp(t->pathname, S_IFDIR|S_IFREG))) { |
1215 |
|
|
1216 |
|
log("%s: Cannot get the timestamp for '%s' at line %d -- %s\n", |
1217 |
|
prog, t->pathname, lineno-1, STRERROR); |
1218 |
|
cfg_errflag++; |
1219 |
|
|
1220 |
|
} |
1221 |
|
|
1222 |
|
if((t->action == ACTION_EXEC) && command) { |
1223 |
|
t->exec= command; |
1224 |
|
command= NULL; |
1225 |
|
} |
1226 |
|
|
1227 |
t->next= current->timestamplist; |
t->next= current->timestamplist; |
1228 |
current->timestamplist= t; |
current->timestamplist= t; |
1298 |
|
|
1299 |
|
|
1300 |
/* |
/* |
1301 |
* Add the current command object to the current service object |
* Add the current command object to the current service object's |
1302 |
|
* start or stop program. |
1303 |
*/ |
*/ |
1304 |
static void addcommand(int what) { |
static void addcommand(int what) { |
1305 |
|
|
1306 |
switch(what) { |
switch(what) { |
1307 |
case START: current->start= command; break; |
case START: current->start= command; break; |
1308 |
case STOP: current->stop= command; break; |
case STOP: current->stop= command; break; |
|
case EXEC: |
|
|
if(current->execlist != NULL) { |
|
|
command->next= current->execlist; |
|
|
} |
|
|
current->execlist= command; |
|
|
break; |
|
1309 |
} |
} |
1310 |
|
|
1311 |
command= NULL; |
command= NULL; |
1323 |
if(! command) { |
if(! command) { |
1324 |
|
|
1325 |
NEW(command); |
NEW(command); |
1326 |
|
check_exec(argument); |
1327 |
|
|
1328 |
} |
} |
1329 |
|
|
1330 |
command->arg[command->length++]= argument; |
command->arg[command->length++]= argument; |
1856 |
} |
} |
1857 |
|
|
1858 |
|
|
1859 |
|
/* |
1860 |
|
* Check if the executable exist |
1861 |
|
*/ |
1862 |
|
static void check_exec(char *exec) { |
1863 |
|
|
1864 |
|
if(! exist_file(exec)) { |
1865 |
|
log("%s: The executable '%s' at line %d does not exist\n", |
1866 |
|
prog, exec, lineno); |
1867 |
|
cfg_errflag++; |
1868 |
|
} |
1869 |
|
|
1870 |
|
} |
1871 |
|
|
1872 |
|
|
1873 |
/* -------------------------------------------------------------------- Misc */ |
/* -------------------------------------------------------------------- Misc */ |
1874 |
|
|