Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 233 of 796  Not logged in ELOG logo
New entries since:Thu Jan 1 01:00:00 1970
ID Date Icon Author Author Email Category OS ELOG Version Subjectup
  65980   Wed Sep 17 22:41:18 2008 Reply Stefan Rittstefan.ritt@psi.chQuestionWindows2.7.4-2111Re: Default list option

 

George Chisholm wrote:

How do I set a default list option?
 I have an attribute called Active with options yes, no
When I do a list I want to see just the records having yes.
When required, the quick filter allows me to see records with option = no or all the records.
Thanks

 

 There is a trick. Use

Start page = ?Active=yes

and use a quick filter on "Active". This will always start with a list where Active=yes.

  66168   Mon Jan 26 14:16:03 2009 Reply Stefan Rittstefan.ritt@psi.chQuestionWindowsV2.6.3Re: Default value radio button

 

Robert-Jan Schrijvers wrote:

Is it possible to attach a default value for a radio button when submitting a new form/record, for example: 

I now have an item "Confirmed" Yes/No, and I want the "no" option to be selected by default when a new form/record is created.
Does anyone know how to arrange this?

Thanks in advance!

You need something along these lines:

Attributes = ..., Confirmed
Options Confirmed = boolean
Preset Confirmed = 1 
  66174   Tue Jan 27 08:06:54 2009 Reply Robert-Jan SchrijversRobert-Jan.Schrijvers@isoft.nlQuestionWindowsV2.6.3Re: Default value radio button

Stefan Ritt wrote:

 

Robert-Jan Schrijvers wrote:

Is it possible to attach a default value for a radio button when submitting a new form/record, for example: 

I now have an item "Confirmed" Yes/No, and I want the "no" option to be selected by default when a new form/record is created.
Does anyone know how to arrange this?

Thanks in advance!

You need something along these lines:

Attributes = ..., Confirmed
Options Confirmed = boolean
Preset Confirmed = 1 

 Good Morning Stefan,

This was very helpful, it works as aspected! Thank you :-)

With regards, Robert-Jan.

  67684   Sat Mar 29 13:14:44 2014 Reply David PilgramDavid.Pilgram@epost.org.ukBug reportLinux2.9.2-a738Re: Defunct daemons
Further work suggests that the type of pdf file might matter, as I have now seen the defunct daemon after
adding the first pdf file in an entry.

However, I have also found that image manipulation (rotation, size) generates a defunct daemon.

> Hi Stefan and Andreas
> 
> Yesterday I reported I had some issues with the latest elog: but now I can reproduce one.  
> elog 2.9.2-a738232
> 
> I started a new entry, and attached three pdf files.  I did not get the problem of not seeing the png thumnbnail
> this time, although that is annoying if you want/need to adjust the thumbnail image before submitting.
> 
> However, if I then look at the running processes, I have the following listed (ps -A)
> 
> 23677 tty1     00:00:04 elogd
> 23809 tty1     00:00:00 elogd <defunct>
> 23825 tty1     00:00:00 elogd <defunct>
> 23847 pts/0    00:00:00 ps
> 
> 23677 was when I started the elogd daemon, having killed off the previous daemon etc for test purposes.
> 
> 23809 and 23825 appeared after a couple of pdfs were added (second and third ones to be precise).  They can only
> be killed off by killing off the original running daemon.  It appears that attaching a second and further pdf
> attachments to any entry generates an elogd <defunct> in the processes list, although attaching a jpg in the
> middle of a list of pdfs didn't (but the next pdf did).  This is happening while adding attachments, that is the
> Submit button has yet to be pressed, so it seems to be generated  when the pdf file is being processed for some
> reason.
> 
> You can end up with quite a stack of these in the process list!
> 
> I never saw this behaviour with the previous version I was running, SVN2475 I think.
> 
> 
> By the way, I still cannot send an attachment over to this server (showing a screenshot) without the 502 error.
  67713   Wed Nov 12 03:19:17 2014 Reply Konstantin Olchanskiolchansk@triumf.caBug reportLinux2.9.2-a738Re: Defunct daemons
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.
  67714   Wed Nov 12 03:48:29 2014 Reply Konstantin Olchanskiolchansk@triumf.caBug reportLinux2.9.2-a738Re: Defunct daemons
> 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.
  67722   Mon Nov 24 13:24:27 2014 Reply Stefan Rittstefan.ritt@psi.chBug reportLinux2.9.2-a738Re: Defunct daemons
> 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
  66418   Thu Jun 25 12:30:17 2009 Reply Stefan Rittstefan.ritt@psi.chRequestLinux2.7.6Re: Denial of access after failed import using invalid attributes

soren poulsen wrote:

Hi,

A user tried to import a CSV file, which caused e-log to add a field called "date" to the list of attributes (and then crash). This caused the log-book to be blocked until someone (guess who) would go edit the elogd.cfg file and then trigger a reload.

1. suggestion : E-log should not crash in this case

2. suggestion: E-log should not allow invalid attributes to be added via CSV Import, which causes the log-book to be blocked.

For the time being, I will just  "Deny import" (by the way, the doc says it is "Deny CSV import", but I think the syntax is "Deny import". Not really important.

I think this should be quite easy to reproduce.

Thanks a lot

Soren

If the CSV file contains a "date" column, elogd tries to interprete the date to the internal format. Now a date can be written in a huge number of variations, and I'm sure I did not cover all. So please send me your CSV file and I will fix the crash. 

ELOG V3.1.5-2eba886