mirror of https://github.com/BOINC/boinc.git
backend program lock files
svn path=/trunk/boinc/; revision=886
This commit is contained in:
parent
2cfd985815
commit
a1bc4a05fa
|
@ -40,6 +40,7 @@ FEEDER_OBJS = \
|
|||
../db/db_mysql.o \
|
||||
../db/mysql_util.o \
|
||||
../lib/parse.o \
|
||||
../lib/util.o \
|
||||
../lib/shmem.o
|
||||
|
||||
SHOW_SHMEM_OBJS = \
|
||||
|
@ -66,6 +67,7 @@ VALIDATE_OBJS = \
|
|||
config.o \
|
||||
../db/db_mysql.o \
|
||||
../db/mysql_util.o \
|
||||
../lib/util.o \
|
||||
../lib/parse.o
|
||||
|
||||
FILE_DELETER_OBJS = \
|
||||
|
@ -73,6 +75,7 @@ FILE_DELETER_OBJS = \
|
|||
config.o \
|
||||
../db/db_mysql.o \
|
||||
../db/mysql_util.o \
|
||||
../lib/util.o \
|
||||
../lib/parse.o
|
||||
|
||||
ASSIMILATOR_OBJS = \
|
||||
|
@ -81,6 +84,7 @@ ASSIMILATOR_OBJS = \
|
|||
config.o \
|
||||
../db/db_mysql.o \
|
||||
../db/mysql_util.o \
|
||||
../lib/util.o \
|
||||
../lib/parse.o
|
||||
|
||||
MAKE_WORK_OBJS = \
|
||||
|
@ -90,6 +94,7 @@ MAKE_WORK_OBJS = \
|
|||
../db/mysql_util.o \
|
||||
../tools/backend_lib.o \
|
||||
../tools/process_result_template.o \
|
||||
../lib/util.o \
|
||||
../lib/parse.o \
|
||||
../lib/md5_file.o \
|
||||
../lib/md5.o \
|
||||
|
@ -101,6 +106,7 @@ RESULT_RETRY_OBJS = \
|
|||
config.o \
|
||||
../db/db_mysql.o \
|
||||
../db/mysql_util.o \
|
||||
../lib/util.o \
|
||||
../lib/parse.o \
|
||||
../lib/md5_file.o \
|
||||
../lib/md5.o \
|
||||
|
|
|
@ -25,9 +25,12 @@
|
|||
|
||||
#include "db.h"
|
||||
#include "parse.h"
|
||||
#include "util.h"
|
||||
#include "config.h"
|
||||
#include "assimilate_handler.h"
|
||||
|
||||
#define ASSIMILATOR_LOCKFILE "assimilator.out"
|
||||
|
||||
CONFIG config;
|
||||
|
||||
void write_log(char* p) {
|
||||
|
@ -131,6 +134,11 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
if (lock_file(ASSIMILATOR_LOCKFILE)) {
|
||||
fprintf(stderr, "Another copy of assimilator is already running\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
write_log("Can't parse config file\n");
|
||||
|
|
|
@ -61,6 +61,8 @@
|
|||
#include "util.h"
|
||||
#include "config.h"
|
||||
|
||||
#define LOCKFILE "db_dump.out"
|
||||
|
||||
#define NRECS_PER_FILE_SUMMARY 1000
|
||||
#define NRECS_PER_FILE_DETAIL 100
|
||||
|
||||
|
@ -522,6 +524,12 @@ int main(int argc, char** argv) {
|
|||
strcpy(dir, argv[++i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (lock_file(LOCKFILE)) {
|
||||
fprintf(stderr, "Another copy of db_dump is already running\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
fprintf(stderr, "Can't parse config file\n");
|
||||
|
|
|
@ -54,12 +54,14 @@
|
|||
|
||||
#include "db.h"
|
||||
#include "shmem.h"
|
||||
#include "util.h"
|
||||
#include "config.h"
|
||||
#include "sched_shmem.h"
|
||||
|
||||
#define RESULTS_PER_ENUM 100
|
||||
#define STOP_SERVER_FILENAME "stop_server"
|
||||
#define REREAD_DB_FILENAME "reread_db"
|
||||
#define LOCKFILE "feeder.out"
|
||||
|
||||
CONFIG config;
|
||||
|
||||
|
@ -220,6 +222,11 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
if (lock_file(LOCKFILE)) {
|
||||
fprintf(stderr, "Another copy of feeder is already running\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (asynch) {
|
||||
if (fork()!=0) {
|
||||
exit(0);
|
||||
|
|
|
@ -27,8 +27,11 @@
|
|||
|
||||
#include "db.h"
|
||||
#include "parse.h"
|
||||
#include "util.h"
|
||||
#include "config.h"
|
||||
|
||||
#define LOCKFILE "file_deleter.out"
|
||||
|
||||
CONFIG config;
|
||||
|
||||
void write_log(char* p) {
|
||||
|
@ -136,6 +139,11 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
if (lock_file(LOCKFILE)) {
|
||||
fprintf(stderr, "Another copy of file deleter is running\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
write_log("Can't parse config file\n");
|
||||
|
|
|
@ -36,11 +36,13 @@
|
|||
|
||||
#include "db.h"
|
||||
#include "crypt.h"
|
||||
#include "util.h"
|
||||
#include "backend_lib.h"
|
||||
#include "config.h"
|
||||
#include "parse.h"
|
||||
|
||||
#define TRIGGER_FILENAME "stop_server"
|
||||
#define LOCKFILE "make_work.out"
|
||||
|
||||
int cushion = 10;
|
||||
int redundancy = 10;
|
||||
|
@ -222,6 +224,11 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
if (lock_file(LOCKFILE)) {
|
||||
fprintf(stderr, "Another copy of make_work is already running\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!strlen(result_template_file)) {
|
||||
write_log("missing -result_template\n");
|
||||
exit(1);
|
||||
|
|
|
@ -36,10 +36,12 @@ using namespace std;
|
|||
#include <sys/time.h>
|
||||
|
||||
#include "db.h"
|
||||
#include "util.h"
|
||||
#include "backend_lib.h"
|
||||
#include "config.h"
|
||||
|
||||
#define TRIGGER_FILENAME "stop_server"
|
||||
#define TRIGGER_FILENAME "stop_server"
|
||||
#define LOCKFILE "result_retry.out"
|
||||
|
||||
int max_errors = 999;
|
||||
int max_done = 999;
|
||||
|
@ -335,19 +337,6 @@ int main(int argc, char** argv) {
|
|||
bool asynch = false, one_pass=false;
|
||||
char path[256];
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
fprintf(stderr, "can't read config file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sprintf(path, "%s/upload_private", config.key_dir);
|
||||
retval = read_key_file(path, key);
|
||||
if (retval) {
|
||||
fprintf(stderr, "can't read key\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
startup_time = time(0);
|
||||
for (i=1; i<argc; i++) {
|
||||
if (!strcmp(argv[i], "-app")) {
|
||||
|
@ -364,6 +353,25 @@ int main(int argc, char** argv) {
|
|||
nredundancy = atoi(argv[++i]);;
|
||||
}
|
||||
}
|
||||
|
||||
if (lock_file(LOCKFILE)) {
|
||||
fprintf(stderr, "Another copy of result_retry is already running\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
fprintf(stderr, "can't read config file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sprintf(path, "%s/upload_private", config.key_dir);
|
||||
retval = read_key_file(path, key);
|
||||
if (retval) {
|
||||
fprintf(stderr, "can't read key\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (asynch) {
|
||||
if (fork()) {
|
||||
exit(0);
|
||||
|
|
|
@ -46,8 +46,11 @@ using namespace std;
|
|||
#include <vector>
|
||||
|
||||
#include "db.h"
|
||||
#include "util.h"
|
||||
#include "config.h"
|
||||
|
||||
#define LOCKFILE "validate.out"
|
||||
|
||||
extern int check_set(vector<RESULT>&, int& canonical, double& credit);
|
||||
extern int check_pair(RESULT&, RESULT&, bool&);
|
||||
|
||||
|
@ -331,6 +334,11 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
if (lock_file(LOCKFILE)) {
|
||||
fprintf(stderr, "Another copy of validate is already running\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (min_quorum < 1 || min_quorum > 10) {
|
||||
sprintf(buf, "bad min_quorum: %d\n", min_quorum);
|
||||
write_log(buf);
|
||||
|
|
Loading…
Reference in New Issue