[rtg] Duplicate pid in pid file
Daniel Shereck
dshereck at omniglobenet.com
Thu Aug 30 10:02:41 EDT 2007
Since I started RTG on boot up, the first time it was started, a pid was
written to the pidfile, but since no targets were present, it left it there.
Once the target list was populated, rtgpoll would not start since there was
a pid already in the file, to remedy this I only put a pid in the pid file
when RTG starts and not before, since it may exit for any of the
Following (target file empty, mysql cant connect …)
….
if (set.verbose >= HIGH)
printf("\nStarting threads.\n");
for (i = 0; i < set.threads; i++) {
crew.member[i].index = i;
crew.member[i].crew = &crew;
if (pthread_create(&(crew.member[i].thread), NULL, poller, (void *)
&(crew.member[i])) != 0)
printf("pthread_create error\n");
}
if (pthread_create(&sig_thread, NULL, sig_handler, (void *)
&(signal_set)) != 0)
printf("pthread_create error\n");
/* give threads time to start up */
sleep(1);
if (set.verbose >= LOW)
printf("RTG Ready.\n");
if (!set.multiple)
checkPID(PIDFILE);
/* Loop Forever Polling Target List */
while (1) {
….
Regards,
Daniel
--
Software Engineer
Omniglobe Networks, Inc
Suite 750, 6600 Trans-Canada Hwy,
Pointre-Claire, Montreal, Quebec
H9R 4S2, Canada
Tel: +1-514-693-8949
Fax: +1-514-697-0186
Eml: HYPERLINK "mailto:dshereck at omniglobenet.com"dshereck at omniglobenet.com
Web: HYPERLINK "http://www.omniglobenet.com"http://www.omniglobenet.com
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.12/979 - Release Date: 8/29/2007
8:21 PM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.grdata.com/pipermail/rtg/attachments/20070830/a9de0973/attachment.html
More information about the RTG
mailing list