*** empty log message ***

svn path=/trunk/boinc/; revision=6232
This commit is contained in:
David Anderson 2005-05-24 04:32:36 +00:00
parent 036583e8b5
commit 7b1bb7bc8f
5 changed files with 26 additions and 5 deletions

View File

@ -6982,3 +6982,12 @@ Rom 23 May 2005
client/
app_graphics.C
David 23 May 2005
- added <sched_lockfile_dir> entry to sched config file (optional).
Specifies where scheduler PID lockfiles are kept
(default is cgi-bin dir)
sched/
handle_request.C
sched_config.C,h

View File

@ -51,6 +51,7 @@ htmlspecialchars("
[ <choose_download_url_by_timezone> N </choose_download_url_by_timezone> ]
[ <cache_md5_info> N </cache_md5_info> ]
[ <nowork_skip> N </nowork_skip> ]
[ <sched_lockfile_dir> path </sched_lockfile_dir> ]
<!-- optional; defaults as indicated: -->
@ -122,6 +123,8 @@ features on the administrative pages. Note: enabling 'grep logs' with
very long log files can hang your server, since grepping GB files can
take a long time. If you enable this feature, be sure to rotate the
logs so that they are not too big.");
list_item("sched_lockfile_dir", "Directory where scheduler lockfiles
are stored. Must be writeable to the Apache user.");
list_end();
echo "

View File

@ -57,21 +57,28 @@ using namespace std;
// instance for this host. Return values same as mylockf().
//
int lock_sched(SCHEDULER_REPLY& reply) {
char filename[64];
char filename[256];
char pid_string[16];
int fd, pid, count;
reply.lockfile_fd=-1;
sprintf(filename, "CGI_%07d", reply.host.id);
if (strlen(config.sched_lockfile_dir)) {
sprintf(filename, "%s/CGI_%07d", config.sched_lockfile_dir, reply.host.id);
} else {
sprintf(filename, "CGI_%07d", reply.host.id);
}
if ((fd=open(filename, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH))<0) return -1;
fd = open(filename, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
if (fd < 0) return -1;
// if we can't get an advisory write lock on the file, return the PID
// of the process that DOES hold the lock.
// if we can't get an advisory write lock on the file,
// return the PID of the process that DOES hold the lock.
//
if ((pid=mylockf(fd))) return pid;
// write PID into the CGI_<HOSTID> file and flush to disk
//
count=sprintf(pid_string, "%d\n", getpid());
write(fd, pid_string, count);
fsync(fd);

View File

@ -69,6 +69,7 @@ int SCHED_CONFIG::parse(char* buf) {
parse_str(buf, "<download_dir_alt>", download_dir_alt, sizeof(download_dir_alt));
parse_str(buf, "<upload_url>", upload_url, sizeof(upload_url));
parse_str(buf, "<upload_dir>", upload_dir, sizeof(upload_dir));
parse_str(buf, "<sched_lockfile_dir>", sched_lockfile_dir, sizeof(sched_lockfile_dir));
parse_bool(buf, "one_result_per_user_per_wu", one_result_per_user_per_wu);
parse_bool(buf, "non_cpu_intensive", non_cpu_intensive);
parse_bool(buf,"homogeneous_redundancy", homogeneous_redundancy);

View File

@ -38,6 +38,7 @@ public:
// (file deleter looks here if not in main dir)
char upload_url[256];
char upload_dir[256];
char sched_lockfile_dir[256];
bool one_result_per_user_per_wu;
bool msg_to_host;
int min_sendwork_interval;