Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon1.gif   Execute new|edit doesn't seem to work, posted by Juergen Diefenbach on Fri Feb 26 17:35:54 2016 
    icon2.gif   Re: Execute new|edit doesn't seem to work, posted by Andreas Luedeke on Sun Feb 28 18:24:58 2016 
       icon2.gif   Re: Execute new|edit doesn't seem to work, posted by Juergen Diefenbach on Mon Mar 7 13:03:13 2016 
          icon2.gif   Re: Execute new|edit doesn't seem to work, posted by Andreas Luedeke on Tue Mar 8 14:12:26 2016 
Message ID: 68270     Entry time: Fri Feb 26 17:35:54 2016     Reply to this: 68272
Icon: Entry  Author: Juergen Diefenbach  Author Email: diefenba@uni-mainz.de 
Category: Bug report  OS: Linux  ELOG Version: 3.1.1 
Subject: Execute new|edit doesn't seem to work 
I am trying to use the "Execute new|edit|delete" feature to track changes to an elog using git.

When a new entry is created a shell script should be executed (certain attributes of the logbook entry should be passed as arguments to it). The script will then automatically stage all changes and create an appropriate git commit message. For a "new" entry in the logbook the commit message is a bit more verbose. When editing or deleting a message only a short commit message like "Edit message 25" should be created. Therefore I really need to distinguish between "new", "edit", and "delete".

However, I experienced unreproducible behavior when creating "new" entries. Sometimes the command specified by "Execute new=" is called, sometimes the one specified by "Execute edit=" is executed. Most of the time it doesn't work as expected. Frown

What I did so far to understand what goes wrong is I looked into elogd.c and found in
void submit_elog(LOGBOOK * lbs)
that bedit is sometimes true and sometimes false, when creating a new entry, although it should be false then (right?).
This is why elogd then sometimes retrieves the wrong shell command from getcfg(lbs->name, "Execute edit"...) instead of getcfg(lbs->name, "Execute new"...) around line 23610 (not exact due to some eprintf()s inserted here and there to look at bedit and so on).

When deleting an entry, everything works fine: the shell command defined via "Execute delete=" is run, but this happens somewhere else in the code so it's not a surprise.

Do you have an idea how to fix this or can you point me in some direction to further track it down? Thank you!
ELOG V3.1.5-fe60aaf