Unless I've missed something in the documentation there is no API to do
this. So in case anyone else ever has such a need, here is a simple perl
script that will do the job. (As written it will only work on little-endian
machines including x86 and x86_64).
#!/usr/bin/perl -w
use Fcntl;
my $dbfile = "/var/spool/pbs/server_priv/serverdb";
sysopen(SERVERDB,"$dbfile",O_RDONLY) or die "can't open $dbfile";
sysseek(SERVERDB,8,0);
print "Current jobid is ",unpack("V",<SERVERDB>),"\n";
close(SERVERDB);
if ($ARGV[0] ){
print "Set jobid to ",$ARGV[0],"\n";
sysopen(SERVERDB,"$dbfile",O_RDWR) or die "can't open $dbfile";
sysseek(SERVERDB,8,0);
syswrite(SERVERDB,pack("V",$ARGV[0]));
close(SERVERDB);
}
--
------------------------------------------------------------------------------
| |
| Dr. Alex Martin |
| e-Mail: [log in to unmask] Queen Mary, University of London, |
| Phone : +44-(0)20-7882-5033 Mile End Road, |
| Fax : +44-(0)20-8981-9465 London, UK E1 4NS |
| |
------------------------------------------------------------------------------
|