Forgot password, posted by Hagelstein, Kay on Mon Feb 27 08:43:22 2006
|
Hi,
the "Forgot password?" option doesn’t work with the Group option.
The elog Version is ELOG V2.6.1-1668
Regards
Kay |
Protect Selection page, posted by Hagelstein, Kay on Thu Feb 23 15:07:53 2006
|
Hi,
I have a problem with the Option “Protect Selection page = 1” it doesn’t word in my Configuration. Is This a bug or a Problem with the Configuration?
Regards
Kay |
Re: Protect Selection page, posted by Stefan Ritt on Thu Feb 23 15:50:20 2006
|
Hagelstein, Kay wrote: | I have a problem with the Option “Protect Selection page = 1” it doesn’t word in my Configuration. Is This a bug or a Problem with the Configuration? |
Thanks for reporting this. I could reproduce the prolem thanks to the config file you supplied. I fixed the problem and made a new release 2.6.1-3. |
Re: Protect Selection page, posted by Hagelstein, Kay on Thu Feb 23 16:36:42 2006
|
Stefan Ritt wrote: |
Hagelstein, Kay wrote: | I have a problem with the Option “Protect Selection page = 1” it doesn’t word in my Configuration. Is This a bug or a Problem with the Configuration? |
Thanks for reporting this. I could reproduce the prolem thanks to the config file you supplied. I fixed the problem and made a new release 2.6.1-3. |
It works now fine.
Thanks & Regards
Kay |
Comment <attr>/Tooltip <attr> not shown in detail view, posted by Holger Mundhahs on Thu Feb 23 12:06:44 2006
|
I've defined a comment or a tooltip for an attribute.
But the text is only shown in NEW/EDIT/REPLY mode, not in detail view.
Is this a bug or how can I enable the text (especially Comment) in
this view? |
Re: Comment <attr>/Tooltip <attr> not shown in detail view, posted by Stefan Ritt on Thu Feb 23 15:20:40 2006
|
Holger Mundhahs wrote: | I've defined a comment or a tooltip for an attribute.
But the text is only shown in NEW/EDIT/REPLY mode, not in detail view.
Is this a bug or how can I enable the text (especially Comment) in
this view? |
I added the tooltip display for the list and detail view. The code will be contained in the next release. |
How to build own/customized selection page?, posted by Holger Mundhahs on Wed Feb 22 19:04:19 2006
|
Hello @all,
with "Selection page = ..." I can link to an self defined selection page for the systems.
As I understand it must be an static page, or how is it possible to define the content based
on the available logbooks or groups?
Regards
Holger |
Re: How to build own/customized selection page?, posted by Stefan Ritt on Wed Feb 22 20:00:19 2006
|
Holger Mundhahs wrote: | Hello @all,
with "Selection page = ..." I can link to an self defined selection page for the systems.
As I understand it must be an static page, or how is it possible to define the content based
on the available logbooks or groups?
Regards
Holger |
Yes it must be a static page. |
List view for CHANGE attributes, posted by Holger Mundhahs on Wed Feb 22 13:49:03 2006 
|
Hello @all,
I've tried to implement an attribute with Change. The detail view works well,
but in the list view the field is empty (see screen shots). Can somebody help me?
Regards
Holger
LOGBOOK CONFIGURATION:
Comment = DEMO
Attributes = Admin, Hostname, IP-Adresse, Funktion, RIB-Hostname, RIB-IP, RIB-Admin
Change RIB-Admin = <a href="https://$RIB-Hostname/" target="_new">$Hostname RIB-Board: $RIB-Hostname</a>
Preset Admin = DEMO
Locked Attributes = Admin, RIB-Admin
Display search = ID, Date, Admin, Hostname, RIB-Admin
List Display = ID, Edit, Date, Admin, Hostname, IP-Adresse, RIB-Admin
Link Display = ID
Page Title = ELOG - $subject
Quick filter = Date, Admin
Default encoding = 1
Suppress default = 3
Show text = 0
Summary lines = 0
Sort Attributes = IP-Adresse |
Re: List view for CHANGE attributes, posted by Stefan Ritt on Wed Feb 22 13:55:08 2006
|
> Hello @all,
> I've tried to implement an attribute with Change. The detail view works well,
> but in the list view the field is empty (see screen shots). Can somebody help me?
For the list view, you need an additional
List Change RIB-Admin = ...
Some people want different modes for the list view and the detail view, that's why there are two options. |
Re: List view for CHANGE attributes, posted by Holger Mundhahs on Wed Feb 22 15:47:45 2006
|
Hello Mr. Ritt,
6 min 5 sek to answer - great. 
Thanks & regards
Holger
Stefan Ritt wrote: | > Hello @all,
> I've tried to implement an attribute with Change. The detail view works well,
> but in the list view the field is empty (see screen shots). Can somebody help me?
For the list view, you need an additional
List Change RIB-Admin = ...
Some people want different modes for the list view and the detail view, that's why there are two options. |
|
svn revision number in the source, posted by Steve Jones on Tue Feb 21 19:25:28 2006
|
There is a variable $Id$ in source that looks like it is supposed to reflect the svn revision number of the compiled code. How is this supposed to be set, manually just before compiling?
Thanks! |
Re: svn revision number in the source, posted by Stefan Ritt on Tue Feb 21 20:24:18 2006
|
Steve Jones wrote: | There is a variable $Id$ in source that looks like it is supposed to reflect the svn revision number of the compiled code. How is this supposed to be set, manually just before compiling? |
It gets set automatically on every commit to the Subversion repository. |
Re: svn revision number in the source, posted by Steve Jones on Tue Feb 21 21:01:22 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | There is a variable $Id$ in source that looks like it is supposed to reflect the svn revision number of the compiled code. How is this supposed to be set, manually just before compiling? |
It gets set automatically on every commit to the Subversion repository. |
So, when we go to the download section and download directly from there, that is not "committed" source? I ask because the revision id there is not set to anything that I can see. |
Re: svn revision number in the source, posted by Stefan Ritt on Tue Feb 21 21:17:13 2006
|
Steve Jones wrote: | So, when we go to the download section and download directly from there, that is not "committed" source? I ask because the revision id there is not set to anything that I can see. |
Can you be a bit more specific? What do you download? The Windows binaries, the Linux RPM? Or from the Subversion repository? The current version in the repository, which you can download here, contains in the file elogd.c following line 8:
$Id: elogd.c 1660 2006-02-17 19:48:12Z ritt $
This tells you that this is revision 1660, committed on Feb. 17 by myself. So what is the problem? |
Re: svn revision number in the source, posted by Steve Jones on Tue Feb 21 21:58:16 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | So, when we go to the download section and download directly from there, that is not "committed" source? I ask because the revision id there is not set to anything that I can see. |
Can you be a bit more specific? What do you download? The Windows binaries, the Linux RPM? Or from the Subversion repository? The current version in the repository, which you can download here, contains in the file elogd.c following line 8:
$Id: elogd.c 1660 2006-02-17 19:48:12Z ritt $
This tells you that this is revision 1660, committed on Feb. 17 by myself. So what is the problem? |
Steve Jones wrote: | Ok, this is really strange but just an hour ago I clicked on the http://midas.psi.ch/elog/download.html link and I was taken to a completely different webview - in fact, I am quite sure that at the bottom right corner it said "WebCVS"! Now, it says WebSVN and the revision info is in there. I've been trying to debug a problem with default.css and the elcode icons - and somewhere in there I cleared my firefox cache. Perhaps an old page was cached????
I have no idea how I got to CVS, and it make sense that CVS was not setting the SVN revision code.
Sorry to botter you on this. |
|
Re: svn revision number in the source, posted by Steve Jones on Tue Feb 21 22:13:40 2006
|
Steve Jones wrote: |
Stefan Ritt wrote: |
Steve Jones wrote: | So, when we go to the download section and download directly from there, that is not "committed" source? I ask because the revision id there is not set to anything that I can see. |
Can you be a bit more specific? What do you download? The Windows binaries, the Linux RPM? Or from the Subversion repository? The current version in the repository, which you can download here, contains in the file elogd.c following line 8:
$Id: elogd.c 1660 2006-02-17 19:48:12Z ritt $
This tells you that this is revision 1660, committed on Feb. 17 by myself. So what is the problem? |
Steve Jones wrote: | Ok, this is really strange but just an hour ago I clicked on the http://midas.psi.ch/elog/download.html link and I was taken to a completely different webview - in fact, I am quite sure that at the bottom right corner it said "WebCVS"! Now, it says WebSVN and the revision info is in there. I've been trying to debug a problem with default.css and the elcode icons - and somewhere in there I cleared my firefox cache. Perhaps an old page was cached????
I have no idea how I got to CVS, and it make sense that CVS was not setting the SVN revision code.
Sorry to bother you on this. |
I just downloaded the tarball from SVN and the revision numbers are set correctly, as you said. I'm stumped as to how I got to CVS. I am running into issues that are related to the stylesheet properties, but that is for a different entry.
Thanks! |
|
Re: svn revision number in the source, posted by Stefan Ritt on Tue Feb 21 22:33:32 2006
|
Steve Jones wrote: | I have no idea how I got to CVS |
I realized that I had an old link to CVS when I checked your previous posting, so I updated that link like 30 min ago. That's why you got a new one. |
Re: svn revision number in the source, posted by Steve Jones on Tue Feb 21 22:37:14 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | I have no idea how I got to CVS |
I realized that I had an old link to CVS when I checked your previous posting, so I updated that link like 30 min ago. That's why you got a new one. |
Ah, thanks. All is now right with the world  |
compiling elog 2.6.1 on solaris platform, posted by Angus Au on Thu Feb 2 03:19:44 2006
|
I came across problem in compiling elog 2.6.1 on solaris platform.
The messages "
# make
gcc -o elog src/elog.c -lutil -lsocket -lnsl
ld: fatal: library -lutil: not found
ld: fatal: File processing errors. No output written to elog
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `elog'
It seems to me that library libutil does not exist on solaris platform.
Is there any fix ? I can compile elog 2.6.0 successfully on solaris. |
Re: compiling elog 2.6.1 on solaris platform, posted by Willem Koster on Fri Feb 3 13:10:14 2006
|
[quote="Angus Au"]I came across problem in compiling elog 2.6.1 on solaris platform.
Is there any fix ? I can compile elog 2.6.0 successfully on solaris.[/quote]
There is a fix, we have 2.6.1 running on Solaris.
A colleague of me installed it and did mention something about having to go through the source and adapting the
makefile. I didn't hear him speak of missing libraries though, I will ask him next week. |
Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Mon Feb 6 08:27:40 2006
|
Angus Au wrote: | ld: fatal: library -lutil: not found |
The util library was added recently because of the new shell substitution functionaly, which requires the forkpty() function call. If you know in which library the forkpty is available on solaris, the makefile could be adjusted accordingly. If the forkpty is not available at all, we have to disable the shell substitution under solaris via conditional compilation. |
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Mon Feb 6 16:44:46 2006
|
Stefan Ritt wrote: |
Angus Au wrote: | ld: fatal: library -lutil: not found |
The util library was added recently because of the new shell substitution functionaly, which requires the forkpty() function call. If you know in which library the forkpty is available on solaris, the makefile could be adjusted accordingly. If the forkpty is not available at all, we have to disable the shell substitution under solaris via conditional compilation. |
Steve Jones wrote: | I have checked and can find no reference within Sun documents regarding the support of the forkpty() function. I have not been following elog development lately -- what is shell substitution supposed to buy us?
-- Ah, just looked at the docs, I see what that buys us. Surely there is a similar function available that is cross platform?
|
|
Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Mon Feb 6 16:48:17 2006
|
Steve Jones wrote: | I have checked and can find no reference within Sun documents regarding the support of the forkpty() function. I have not been following elog development lately -- what is shell substitution supposed to buy us? |
See the config manual and look for $shell |
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Wed Feb 8 18:19:02 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | I have checked and can find no reference within Sun documents regarding the support of the forkpty() function. I have not been following elog development lately -- what is shell substitution supposed to buy us? |
See the config manual and look for $shell |
Steve Jones wrote: | Yep, I saw it. Thanks |
|
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Wed Feb 8 18:34:43 2006
|
Steve Jones wrote: |
Stefan Ritt wrote: |
Steve Jones wrote: | I have checked and can find no reference within Sun documents regarding the support of the forkpty() function. I have not been following elog development lately -- what is shell substitution supposed to buy us? |
See the config manual and look for $shell |
Steve Jones wrote: | Yep, I saw it. Thanks |
|
Steve Jones wrote: |
Stefan, I found the following "forkpty()" replacement for running under Solaris. The URL is http://www.developerweb.net/forum/showthread.php?t=2990.
Perhaps this can be used unless someone comes up with a Solaris "util" library.
#ifdef SOLARIS /* Use the code in my_forkpty.c */
int my_forkpty (int *amaster, char *name, void *unused1, void *unused2);
#define forkpty my_forkpty
#endif
-----------------------
my_forkpty.c
-----------------------
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/stream.h>
#include <sys/stropts.h>
/* fork_pty() remplacement for Solaris.
* This ignore the last two arguments
* for the moment
*/
int
my_forkpty (int *amaster,
char *name,
void *unused1,
void *unused2)
{
int master, slave;
char *slave_name;
pid_t pid;
master = open("/dev/ptmx", O_RDWR);
if (master < 0)
return -1;
if (grantpt (master) < 0)
{
close (master);
return -1;
}
if (unlockpt (master) < 0)
{
close (master);
return -1;
}
slave_name = ptsname (master);
if (slave_name == NULL)
{
close (master);
return -1;
}
slave = open (slave_name, O_RDWR);
if (slave < 0)
{
close (master);
return -1;
}
if (ioctl (slave, I_PUSH, "ptem") < 0
|| ioctl (slave, I_PUSH, "ldterm") < 0)
{
close (slave);
close (master);
return -1;
}
if (amaster)
*amaster = master;
if (name)
strcpy (name, slave_name);
pid = fork ();
switch (pid)
{
case -1: /* Error */
return -1;
case 0: /* Child */
close (master);
dup2 (slave, STDIN_FILENO);
dup2 (slave, STDOUT_FILENO);
dup2 (slave, STDERR_FILENO);
return 0;
default: /* Parent */
close (slave);
return pid;
}
return -1;
}
|
|
Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Fri Feb 10 13:58:17 2006
|
Steve Jones wrote: | Stefan, I found the following "forkpty()" replacement for running under Solaris. |
Ok, I put your code into the current SVN revision (1656). Unfortunately I cannot try it due to the lack of a Sun. Maybe you can try and tell me if it's working.
- Stefan |
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Fri Feb 10 17:22:36 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | Stefan, I found the following "forkpty()" replacement for running under Solaris. |
Ok, I put your code into the current SVN revision (1656). Unfortunately I cannot try it due to the lack of a Sun. Maybe you can try and tell me if it's working.
- Stefan |
Steve Jones wrote: |
Actually, what I will be delivering is a new Makefile with conditional compile statements plus the C code module since the example that I provided need some cleaning. Since I don't have a Linux system on which to test the conditional compile completely I would need you to do that. Sound ok?
|
|
Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Fri Feb 10 17:29:03 2006
|
Steve Jones wrote: | Actually, what I will be delivering is a new Makefile with conditional compile statements plus the C code module since the example that I provided need some cleaning. Since I don't have a Linux system on which to test the conditional compile completely I would need you to do that. Sound ok?
|
Sure. I put already the conditional compiling into the current Makefile, so just try it. I tested the Linux part, which is ok. If you could test the Solaris part, that would be great. |
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Fri Feb 10 20:24:56 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | Actually, what I will be delivering is a new Makefile with conditional compile statements plus the C code module since the example that I provided need some cleaning. Since I don't have a Linux system on which to test the conditional compile completely I would need you to do that. Sound ok?
|
Sure. I put already the conditional compiling into the current Makefile, so just try it. I tested the Linux part, which is ok. If you could test the Solaris part, that would be great. |
Ok, I see what you did. I took a different route since I was not sure how the gnu linker would handle the fact that there would be two declarations of the forkpty() function when compiled and linked under Linux. Instead, I created a separate forkpty.c module and compiled it separately. Then, if "solaris", link it in. Otherwise, use library "util" which already has forkpty().
So, since it seems to work under Linux, any idea which function is being used? |
Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Fri Feb 10 20:29:12 2006
|
Steve Jones wrote: | Ok, I see what you did. I took a different route since I was not sure how the gnu linker would handle the fact that there would be two declarations of the forkpty() function when compiled and linked under Linux. Instead, I created a separate forkpty.c module and compiled it separately. Then, if "solaris", link it in. Otherwise, use library "util" which already has forkpty().
So, since it seems to work under Linux, any idea which function is being used? |
No, there are no two forkpty() function, due to the
#ifdef OS_SOLARIS
forkpty(...)
{
...
}
#endif
conditional compiling. So if I compile under Linux, the variable OS_SOLARIS is not defined, and therefore the special forkpty does not get compiled. Instead the one from the library is taken, since under Linux I use the -libutil switch. Under Solaris, there is no -libutil, but the OS_SOLARIS gets set, and therefore we have the code right inside elogd.c |
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Fri Feb 10 21:52:35 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | Ok, I see what you did. I took a different route since I was not sure how the gnu linker would handle the fact that there would be two declarations of the forkpty() function when compiled and linked under Linux. Instead, I created a separate forkpty.c module and compiled it separately. Then, if "solaris", link it in. Otherwise, use library "util" which already has forkpty().
So, since it seems to work under Linux, any idea which function is being used? |
No, there are no two forkpty() function, due to the
#ifdef OS_SOLARIS
forkpty(...)
{
...
}
#endif
conditional compiling. So if I compile under Linux, the variable OS_SOLARIS is not defined, and therefore the special forkpty does not get compiled. Instead the one from the library is taken, since under Linux I use the -libutil switch. Under Solaris, there is no -libutil, but the OS_SOLARIS gets set, and therefore we have the code right inside elogd.c
Steve Jones wrote: |
Got it. Much easier than how I was going about it.
|
|
|
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Fri Feb 10 22:31:38 2006
|
Steve Jones wrote: |
Stefan Ritt wrote: |
Steve Jones wrote: | Ok, I see what you did. I took a different route since I was not sure how the gnu linker would handle the fact that there would be two declarations of the forkpty() function when compiled and linked under Linux. Instead, I created a separate forkpty.c module and compiled it separately. Then, if "solaris", link it in. Otherwise, use library "util" which already has forkpty().
So, since it seems to work under Linux, any idea which function is being used? |
No, there are no two forkpty() function, due to the
#ifdef OS_SOLARIS
forkpty(...)
{
...
}
#endif
conditional compiling. So if I compile under Linux, the variable OS_SOLARIS is not defined, and therefore the special forkpty does not get compiled. Instead the one from the library is taken, since under Linux I use the -libutil switch. Under Solaris, there is no -libutil, but the OS_SOLARIS gets set, and therefore we have the code right inside elogd.c
Steve Jones wrote: |
Got it. Much easier than how I was going about it.
|
|
|
BTW, Stefan, this code in Makefile does not work on Solaris
OSTYPE = $(shell uname)
.
.
.
ifeq ($(OSTYPE),solaris)
At least, not on our solaris systems. 'uname' returns SunOS. When I run 'make -P' or 'gmake -P' the environment variable 'OSTYPE' is already set to 'solaris'. This is the reason the original Makefile did not work on our solaris systems. I'm not sure if this is universal but it applies to the systems we run (Solaris 8 and 9). |
Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Fri Feb 10 22:35:20 2006
|
Steve Jones wrote: | BTW, Stefan, this code in Makefile does not work on Solaris
OSTYPE = $(shell uname)
.
.
.
ifeq ($(OSTYPE),solaris)
At least, not on our solaris systems. 'uname' returns SunOS. |
Ok, what about adding:
ifeq ($(OSTYPE),SunOS)
OSTYPE=solaris
endif |
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Mon Feb 13 18:22:08 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | BTW, Stefan, this code in Makefile does not work on Solaris
OSTYPE = $(shell uname)
.
.
.
ifeq ($(OSTYPE),solaris)
At least, not on our solaris systems. 'uname' returns SunOS. |
Ok, what about adding:
ifeq ($(OSTYPE),SunOS)
OSTYPE=solaris
endif |
Steve Jones wrote: |
That would work, but my question is "why is this statement needed at all?" In GNU-land it appears that the make utilities use the canonical names rather than the ones returned by the OS. When I simply comment out this section, the solaris compile works fine. Perhaps it does not on other platforms?
Also, I ran into another snag. The include file "pty.h" does not appear to exist in solaris-land, so I am seeing if there is one made available elsewhere.
|
|
Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Mon Feb 20 17:52:06 2006
|
Steve Jones wrote: |
Stefan Ritt wrote: |
Steve Jones wrote: | BTW, Stefan, this code in Makefile does not work on Solaris
OSTYPE = $(shell uname)
.
.
.
ifeq ($(OSTYPE),solaris)
At least, not on our solaris systems. 'uname' returns SunOS. |
Ok, what about adding:
ifeq ($(OSTYPE),SunOS)
OSTYPE=solaris
endif |
Steve Jones wrote: |
That would work, but my question is "why is this statement needed at all?" In GNU-land it appears that the make utilities use the canonical names rather than the ones returned by the OS. When I simply comment out this section, the solaris compile works fine. Perhaps it does not on other platforms?
Also, I ran into another snag. The include file "pty.h" does not appear to exist in solaris-land, so I am seeing if there is one made available elsewhere.
|
|
In working with Stefan changes were made so that the latest release should once again cross-compile fine, and Makefile also works under Solaris. Great job Stefan! |
CONCERN: Cross-platform compiling at risk, posted by Steve Jones on Tue Feb 14 16:22:56 2006
|
Stefan, I am concerned that there are becoming too many Linux dependencies in terms of required libraries and header files. Although we have a replacement for the forkpty() routine, I am running into many other dependencies, the latest of which is pty.h. Aren't there guidelines in GCC that point out what is available cross-platform and what is not? For example, any SVR# (System Five, Release XX) based Unix will not include the forkpty() function, but BSD derivatives will.
Currently we are stuck at eLog 2.5.9 because of this issue. |
Re: CONCERN: Cross-platform compiling at risk, posted by Stefan Ritt on Tue Feb 14 17:43:15 2006
|
Steve Jones wrote: | Stefan, I am concerned that there are becoming too many Linux dependencies in terms of required libraries and header files. Although we have a replacement for the forkpty() routine, I am running into many other dependencies, the latest of which is pty.h. Aren't there guidelines in GCC that point out what is available cross-platform and what is not? For example, any SVR# (System Five, Release XX) based Unix will not include the forkpty() function, but BSD derivatives will.
Currently we are stuck at eLog 2.5.9 because of this issue. |
The whole issue with the forkpty() came from the request of the shell subsitution. I managed to compile this under Linux and under Windows, so I was under the impression that this is not too specific (although I had to use completely different approaches for Linux and Windows). Now if you tell me that this is not true, we have basically two options:
1) Make the shell substitution an option. On systems which don't have a forkpty(), don't compile it in. I guess not many people need the shell substitution. Thos people who need it have to stick to certain Unix flavours.
2) Find equivalents of forkpty() on all systems. The problem with that is that I have to rely on others like you to supply me some code for other systems and test it.
Please let me know what option you prefer. Also other users are asked for their opinion.
Best regards,
Stefan |
Re: CONCERN: Cross-platform compiling at risk, posted by Steve Jones on Tue Feb 14 22:31:08 2006
|
Steve Jones wrote: |
Stefan Ritt wrote: |
Steve Jones wrote: | Stefan, I am concerned that there are becoming too many Linux dependencies in terms of required libraries and header files. Although we have a replacement for the forkpty() routine, I am running into many other dependencies, the latest of which is pty.h. Aren't there guidelines in GCC that point out what is available cross-platform and what is not? For example, any SVR# (System Five, Release XX) based Unix will not include the forkpty() function, but BSD derivatives will.
Currently we are stuck at eLog 2.5.9 because of this issue. |
The whole issue with the forkpty() came from the request of the shell subsitution. I managed to compile this under Linux and under Windows, so I was under the impression that this is not too specific (although I had to use completely different approaches for Linux and Windows). Now if you tell me that this is not true, we have basically two options:
1) Make the shell substitution an option. On systems which don't have a forkpty(), don't compile it in. I guess not many people need the shell substitution. Thos people who need it have to stick to certain Unix flavours.
2) Find equivalents of forkpty() on all systems. The problem with that is that I have to rely on others like you to supply me some code for other systems and test it.
Please let me know what option you prefer. Also other users are asked for their opinion.
Best regards,
Stefan |
Stefan et al.
I think it would be preferrable if we could find a routine that performed the same function but that was available under Windows/Linux/Unix. Question: Is the functionality really just to issue an arbitrary command-string to a "shell" and have the result stuffed back into an eLog variable? I'm not an expert but it would seem that such a feature would be universally available or could be used to construct a suitable routine.
If possible, could one use the int system(const char *s); function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps char *tmpnam(char *s); , running a command via int system(const char *s); , then opening that file for a read would accomplish what is being desired?
|
|
Re: CONCERN: Cross-platform compiling at risk, posted by Stefan Ritt on Wed Feb 15 18:25:15 2006
|
Steve Jones wrote: | Question: Is the functionality really just to issue an arbitrary command-string to a "shell" and have the result stuffed back into an eLog variable? I'm not an expert but it would seem that such a feature would be universally available or could be used to construct a suitable routine.
If possible, could one use the int system(const char *s); function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps char *tmpnam(char *s); , running a command via int system(const char *s); , then opening that file for a read would accomplish what is being desired?
|
Indeed the results from the "shell" need to be stuffed back into an elog attribute, that's why you cannot use the system() function directly. The idea with the tmpnam() could however be a clever workaround. I have to see if this works under Windows. If so, it would be a much more portable alternative to forkpty(). |
Re: CONCERN: Cross-platform compiling at risk, posted by Steve Jones on Wed Feb 15 19:02:32 2006
|
Steve Jones wrote: |
Stefan Ritt wrote: |
Steve Jones wrote: | Question: Is the functionality really just to issue an arbitrary command-string to a "shell" and have the result stuffed back into an eLog variable? I'm not an expert but it would seem that such a feature would be universally available or could be used to construct a suitable routine.
If possible, could one use the int system(const char *s); function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps char *tmpnam(char *s); , running a command via int system(const char *s); , then opening that file for a read would accomplish what is being desired?
|
Indeed the results from the "shell" need to be stuffed back into an elog attribute, that's why you cannot use the system() function directly. The idea with the tmpnam() could however be a clever workaround. I have to see if this works under Windows. If so, it would be a much more portable alternative to forkpty(). |
Yes, these routines are from the standard C libraries. tmpname() returns a pointer to a filename guaranteed to be unique, then you can create that file. tmpfile() actually creates a temporary file and returns a pointer to the filestream, and auto cleans up upon stream termination. system() passes the command string to the shell/commandproc if available. You could wrap these into a single callable function that is called 'shell()' and accomplish your first gola plus achieve cross-platformness again ;->
My 2 cents - hope that is enough!
|
|
Re: CONCERN: Cross-platform compiling at risk, posted by Stefan Ritt on Fri Feb 17 13:31:00 2006
|
Steve Jones wrote: | If possible, could one use the int system(const char *s); function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps char *tmpnam(char *s); , running a command via int system(const char *s); , then opening that file for a read would accomplish what is being desired?
|
I implemented exprimentally such a code. Instead of tmpnam() (which the compiler claims to be obsolete), I use a hard-wired file name /tmp/elog-shell for that purpose. I put it under /tmp so that the "elog" user (under which elog should normally run) is able to write to. Can you please check if that works fine now under Solaris? |
Re: CONCERN: Cross-platform compiling at risk, posted by Steve Jones on Mon Feb 20 17:50:33 2006
|
Stefan Ritt wrote: |
Steve Jones wrote: | If possible, could one use the int system(const char *s); function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps char *tmpnam(char *s); , running a command via int system(const char *s); , then opening that file for a read would accomplish what is being desired?
|
I implemented exprimentally such a code. Instead of tmpnam() (which the compiler claims to be obsolete), I use a hard-wired file name /tmp/elog-shell for that purpose. I put it under /tmp so that the "elog" user (under which elog should normally run) is able to write to. Can you please check if that works fine now under Solaris? |
The compiled version runs fine under Solaris9. When executing Subst Subject = $shell(uname) I got:
"SunOS" !!! ;->
So, short of the items I pointed out below I would say that you have successfully re-rendered eLog as a truly cross platform application once again! My hat is off to you!
thanks
Steve |