Re: Defunct daemons, posted by Konstantin Olchanski on Wed Nov 12 03:19:17 2014
|
Also see this in ALPHA at CERN. Eventually there are so many defunct elogd processes that the user runs out of "maxproc" quota and automatic submission
of elog messages starts to fail. (and the users complain, reboot all computers, etc).
The elogd we use is this:
https://bitbucket.org/ritt/elog/commits/44800a769b99599db7620779e2142b1161c694fc?at=master
The best I can tell, the main elogd is spawning something but does not reap finished subprocesses (wait() syscall). My guess it is spawning ImageMagik stuff
to create preview images.
K.O. |
Re: Defunct daemons, posted by Konstantin Olchanski on Wed Nov 12 03:48:29 2014
|
> Also see this in ALPHA at CERN.
> The elogd we use is this: https://bitbucket.org/ritt/elog/commits/44800a769b99599db7620779e2142b1161c694fc?at=master
Okey, found it. waitpid() in my_shell() is not protected against the periodic alarm signal. (UNIX signals are evil).
In the following log file, notice the entries that have "wait_status" of "-1". Those would have generated zombies ("defunct" processes).
Nov 12 03:43:05 alphacpc05 elogd[4809]: WAITPID pid 4873, wait_status 4873, errno 2 (No such file or directory), status 0, command "convert
'/home/alpha/online/elog/logbooks/test/141112_034304_xvthr04.pdf[0-7]' -thumbnail '600' '/home/alpha/online/elog/logbooks/test/141112_034304_xvthr04-%d.png'"
Nov 12 03:43:05 alphacpc05 elogd[4809]: WAITPID pid 4880, wait_status 4880, errno 2 (No such file or directory), status 0, command "identify -format '%wx%h'
'/home/alpha/online/elog/logbooks/test/141112_034304_xvthr04.pdf[0]'"
Nov 12 03:43:19 alphacpc05 elogd[4809]: WAITPID pid 4890, wait_status 4890, errno 2 (No such file or directory), status 0, command "identify -format '%wx%h'
'/home/alpha/online/elog/logbooks/test/141112_034304_xvthr04.pdf[0]'"
Nov 12 03:43:19 alphacpc05 elogd[4809]: WAITPID pid 4896, wait_status -1, errno 4 (Interrupted system call), status 0, command "convert
'/home/alpha/online/elog/logbooks/test/141112_034318_xvthr05.pdf[0-7]' -thumbnail '600' '/home/alpha/online/elog/logbooks/test/141112_034318_xvthr05-%d.png'"
Nov 12 03:43:19 alphacpc05 elogd[4809]: WAITPID pid 4896, wait_status 4896, errno 4 (Interrupted system call), status 0, command "convert
'/home/alpha/online/elog/logbooks/test/141112_034318_xvthr05.pdf[0-7]' -thumbnail '600' '/home/alpha/online/elog/logbooks/test/141112_034318_xvthr05-%d.png'"
Nov 12 03:43:20 alphacpc05 elogd[4809]: WAITPID pid 4904, wait_status 4904, errno 4 (Interrupted system call), status 0, command "identify -format '%wx%h'
'/home/alpha/online/elog/logbooks/test/141112_034318_xvthr05.pdf[0]'"
Nov 12 03:43:48 alphacpc05 elogd[4809]: WAITPID pid 4922, wait_status 4922, errno 2 (No such file or directory), status 0, command "identify -format '%wx%h'
'/home/alpha/online/elog/logbooks/test/141112_034304_xvthr04.pdf[0]'"
Nov 12 03:43:49 alphacpc05 elogd[4809]: WAITPID pid 4929, wait_status -1, errno 4 (Interrupted system call), status 1302603136, command "identify -format '%wx%h'
'/home/alpha/online/elog/logbooks/test/141112_034318_xvthr05.pdf[0]'"
Nov 12 03:43:49 alphacpc05 elogd[4809]: WAITPID pid 4929, wait_status 4929, errno 4 (Interrupted system call), status 0, command "identify -format '%wx%h'
'/home/alpha/online/elog/logbooks/test/141112_034318_xvthr05.pdf[0]'"
Nov 12 03:43:50 alphacpc05 elogd[4809]: WAITPID pid 4935, wait_status 4935, errno 2 (No such file or directory), status 0, command "convert
'/home/alpha/online/elog/logbooks/test/141112_034348_xvthr06.pdf[0-7]' -thumbnail '600' '/home/alpha/online/elog/logbooks/test/141112_034348_xvthr06-%d.png'"
Nov 12 03:43:50 alphacpc05 elogd[4809]: WAITPID pid 4943, wait_status 4943, errno 2 (No such file or directory), status 0, command "identify -format '%wx%h'
'/home/alpha/online/elog/logbooks/test/141112_034348_xvthr06.pdf[0]'"
The following code is verified to not generate zombies, please apply it to the master branch of elog:
alphadaq.cern.ch:~/packages/elog> git diff
diff --git a/src/elogd.c b/src/elogd.c
index 277ba30..2d9a848 100755
--- a/src/elogd.c
+++ b/src/elogd.c
@@ -892,14 +892,25 @@ int my_shell(char *cmd, char *result, int size)
#ifdef OS_UNIX
pid_t child_pid;
- int fh, status, i;
+ int fh, status, i, wait_status;
char str[1024];
if ((child_pid = fork()) < 0)
return 0;
else if (child_pid > 0) {
/* parent process waits for child */
- waitpid(child_pid, &status, 0);
+
+ while (1) {
+ wait_status = waitpid(child_pid, &status, 0);
+
+ sprintf(str, "WAITPID pid %d, wait_status %d, errno %d (%s), status %d, command \"%s\"", child_pid, wait_status, errno, strerror(errno), status, cmd);
+ write_logfile(NULL, str);
+ eprintf("%s", str);
+
+ if (wait_status == -1 && errno == EINTR)
+ continue;
+ break;
+ }
/* read back result */
memset(result, 0, size);
diff --git a/src/git-revision.h b/src/git-revision.h
K.O. |
Elogbook on windows 8, posted by Ciaran White on Wed Nov 12 11:03:37 2014
|
i have been using elogbook V2.7.6 on my XP machine for a number of years. I ahve recently upgraded to windows 8 and the reply function on my entries has changed. I can now see the previous entrys in HTML format rather than the reply box which used to appear and also my ability to upload attachments and paste working linls is removed. Do i need to upgrade to the latest version and do i ned to back up my previous entries and how do i do this?
Thank you |
Re: Elogbook on windows 8, posted by Stefan Ritt on Mon Nov 24 13:10:13 2014
|
Ciaran White wrote: |
i have been using elogbook V2.7.6 on my XP machine for a number of years. I ahve recently upgraded to windows 8 and the reply function on my entries has changed. I can now see the previous entrys in HTML format rather than the reply box which used to appear and also my ability to upload attachments and paste working linls is removed. Do i need to upgrade to the latest version and do i ned to back up my previous entries and how do i do this?
Thank you
|
Upgrading Windows should not change the behavior of ELOG, unless you made a mistake during re-installation of ELOG. Can you post a picture on how your reply looks like, it's hard for me to understand what you write.
/Stefan |
Re: Defunct daemons, posted by Stefan Ritt on Mon Nov 24 13:24:27 2014
|
> Okey, found it. waitpid() in my_shell() is not protected against the periodic alarm signal. (UNIX signals are evil).
Acknowledged. Thanks for the fix. I added it to the development branch.
/Stefan |
Error report while submitting the entry, posted by harish amin on Mon Nov 24 18:29:34 2014 
|
Dear Stefan,
I am having a log book with the 5 logbooks. All other books are working fine except only one, every time while submitting the entry I am getting a error message.
I have attached the screen shot along with the error log file.
Please help me in solving this bug.
Regards
Harish Amin |
Re: Error report while submitting the entry, posted by Stefan Ritt on Tue Nov 25 12:36:47 2014
|
harish amin wrote: |
Dear Stefan,
I am having a log book with the 5 logbooks. All other books are working fine except only one, every time while submitting the entry I am getting a error message.
I have attached the screen shot along with the error log file.
Please help me in solving this bug.
Regards
Harish Amin
|
It's hard to guess from the information you sent what is wrong. The program just crashes, after the email notification has been sent successfully. Can you check if the one logbook which is not working is using some path for the logbook directory which it cannot write to due to access limitations? Just a guess.
-Stefan |
Re: Error report while submitting the entry, posted by harish amin on Wed Nov 26 12:49:12 2014
|
Stefan Ritt wrote: |
harish amin wrote: |
Dear Stefan,
I am having a log book with the 5 logbooks. All other books are working fine except only one, every time while submitting the entry I am getting a error message.
I have attached the screen shot along with the error log file.
Please help me in solving this bug.
Regards
Harish Amin
|
It's hard to guess from the information you sent what is wrong. The program just crashes, after the email notification has been sent successfully. Can you check if the one logbook which is not working is using some path for the logbook directory which it cannot write to due to access limitations? Just a guess.
-Stefan
|
Dear Stefen,
I am attaching the config file details of the the logbook which crashes. Please check and reply.
Admin user = harish
password File = eng.pwd
;self register = 1
;Login expiration = 0.18
Theme = default
Comment = Lifesciences Pvt.Ltd.
Menu commands = List, New, Reply, Find, Logout, Help
Attributes = SUBJECT INITIALS, SUBJECT ID, SUBJECT DATE, ASSESSMENT OF VITALS:(To be transcribed from Source Note)Time, Pulse Rate(Per minute), Blood Pressure(mm Hg), CAFFEINE HISTORY:Coffee-Intake(No.of servings), Reasons, Tea-Intake(No.of servings), Reasons, Cocoa-Intake(No.of servings), Reasons, Chocolates-Intake(No.of servings), Reasons, Soft Drinks-Intake(No.of servings), Reasons, Comments(If any), STANDARDIZED MEAL:Start Time, End Time, Comments(If any), EPWORTHS SLEEPING SCALE:Date, Start Time, End Time, Sitting and Reading-score, Watching Tv-score, Sitting inactive in public place(e.g.a theatre or meeting)-score, As a passenger in the car/bus for an without break-score, Lying down to rest in the afternoon when circumstances permit-score, Sitting and talking to someone-score, Sitting quietly after lunch without alcohal-score, In a car/bus while stopped for a few minutes in traffic-score, Total Score, ANT PERFORMANCE:Pre IP Administration Date, Start time, End Time, Media Response Time(ms)-score, Alerting Effect(ms)-score, Orienting effect(ms)-score, Executive Attention(ms)-score, C-VAMS ASSESSMENTS:Pre IP Administration Date, Start Time, End Time, Lethargic to vigorous-score, Muddled to Clear Headed-score, Tired to Energetic-score, Unimaginative to Imaginative-score, Listless to Full of go-score, Inefficient to Efficient-score, Total, IP DISPENSING TIME, Lag Phase End Time, SUBJECT DIARY CHECKED AND DISPENSED, ANT PERFORMANCE:1 Hour 10 Minutes Post IP Administration Date, Start time, End Time, Media Response Time(ms)-score, Alerting Effect(ms)-score, Orienting Effect(ms)-score, Executive Attention(ms)-score, C-VAMS ASSESSMENTS:1 Hour 10 Minutes Post IP Administration Date, Start Time, End Time, Lethargic to vigorous-score, Muddled to Clear Headed-score, Tired to Energetic-score, Unimaginative to Imaginative-score, Listless to Full of go-score, Inefficient to Efficient-score, Total, ASSESSMENT OF VITALS:(1 Hour 10 Minutes) Time, Pulse Rate(Per minute), Blood Pressure(mm Hg), ANT PERFORMANCE:3 Hour 10 Minutes Post IP Administration Date, Start time, End Time, Media Response Time(ms)-score, Alerting Effect(ms)-score, Orienting Effect(ms)-score, Executive Attention(ms)-score, C-VAMS ASSESSMENTS:3 Hour 10 Minutes Post IP Administration Date, Start Time, End Time, Lethargic to vigorous-score, Muddled to Clear Headed-score, Tired to Energetic-score, Unimaginative to Imaginative-score, Listless to Full of go-score, Inefficient to Efficient-score, Total, ASSESSMENT OF VITALS:(3 Hour 10 Minutes)Time, Pulse Rate(Per minute), Blood Pressure(mm Hg), ANT PERFORMANCE:5 Hour 10 Minutes Post IP Administration Date, Start time, End Time, Media Response Time(ms)-score, Alerting Effect(ms)-score, Orienting Effect(ms)-score, Executive Attention(ms)-score, C-VAMS ASSESSMENTS:5 Hour 10 Minutes Post IP Administration Date, Start Time, End Time, Lethargic to vigorous-score, Muddled to Clear headed-score, Tired to Energetic-score, Unimaginative to Imaginative-score, Listless to Full of go-score, Inefficient to Efficient-score, Total, ASSESSMENT OF VITALS:(5 Hour 10 Minutes)Time, Pulse Rate(Per minute), Blood Pressure(mm Hg)
Options Reasons = Habitual, Urge for caffeine, Facing withdrawl, Others;Specify
Options SUBJECT DIARY CHECKED AND DISPENSED = Yes, No
Page Title = ELOG - $subject
Reverse sort = 1 |
|