Re: Missing log files when rsync to replacement server., posted by VUIIS SysAdmin on Fri Jul 31 21:40:02 2020
|
On the new server in the logbook that should have several 2020 entries it stops on the last entry of 2019.
On the old server after stopping elogd i get:
/usr/sbin/elogd -v 3
Cannot open "elogd.cfg": No such file or directory
Are the files supposed to be in /usr/local/elog or /usr/share/elog? I have both on the old server. I only synced /usr/local/elog to the new server. In any case the Logbook with 2020 entries does not show a 2020 directory.
My backup system also does not show any 2020 logbook directories. It was current up to this week when I started this process.
Stefan Ritt wrote: |
Start your new server interactively with "elogd -v 3" to see all verbose output. You will then see how it indexes all logbooks. If not, you might have a wrong path in elogd.cfg
VUIIS SysAdmin wrote: |
I am moving from a Hyper-V host to a VMware host and created a new elog server. I installed the elog software and did an rsync to get the .cfg file and logbooks to the new server.
rsync -av root@old.elog.server:/usr/local/elog /usr/local/
On the new server all of the 2020 entries are missing and there does not appear to be a 2020 logbook on either server but I can still access the 2020 entries on the old server. Where might they be and how do I get them over to the new server.
Old server says version is ELOG V3.1.4-unknown and new server says version is ELOG V3.1.4-966e3dd
Bothe servers a fully updated CentOS 7.
|
|
|
Re: Missing log files when rsync to replacement server., posted by Stefan Ritt on Sat Aug 1 15:13:17 2020
|
You can put your files where ever you want, just tell elogd where to find the elogd.cfg file via the "-c" flag. Then tell elogd where to find files in the elogd.cfg file via the "Logbook dir" and "Resource dir" directives.
Stefan
VUIIS SysAdmin wrote: |
On the new server in the logbook that should have several 2020 entries it stops on the last entry of 2019.
On the old server after stopping elogd i get:
/usr/sbin/elogd -v 3
Cannot open "elogd.cfg": No such file or directory
Are the files supposed to be in /usr/local/elog or /usr/share/elog? I have both on the old server. I only synced /usr/local/elog to the new server. In any case the Logbook with 2020 entries does not show a 2020 directory.
My backup system also does not show any 2020 logbook directories. It was current up to this week when I started this process.
|
|
Re: Missing log files when rsync to replacement server., posted by VUIIS SysAdmin on Sun Aug 2 02:57:59 2020
|
Thank-you. That is good information to have.
What is the default if you you do not specify anything in elogd.cfg? I assume it is /usr/local/elog otherwise it would not see the existing logbooks.
With a default Linux RPM install, where else would the logbooks be? Still looking for a 2020 directory on either server.
Bruce
Stefan Ritt wrote: |
You can put your files where ever you want, just tell elogd where to find the elogd.cfg file via the "-c" flag. Then tell elogd where to find files in the elogd.cfg file via the "Logbook dir" and "Resource dir" directives.
Stefan
VUIIS SysAdmin wrote: |
On the new server in the logbook that should have several 2020 entries it stops on the last entry of 2019.
On the old server after stopping elogd i get:
/usr/sbin/elogd -v 3
Cannot open "elogd.cfg": No such file or directory
Are the files supposed to be in /usr/local/elog or /usr/share/elog? I have both on the old server. I only synced /usr/local/elog to the new server. In any case the Logbook with 2020 entries does not show a 2020 directory.
My backup system also does not show any 2020 logbook directories. It was current up to this week when I started this process.
|
|
|
Re: Missing log files when rsync to replacement server., posted by Stefan Ritt on Sun Aug 2 09:06:46 2020
|
If nothing is specified elogd looks for logbooks in the current directory where it got started under ./logbooks/
No idea what happened to your 2020 logbook.
VUIIS SysAdmin wrote: |
Thank-you. That is good information to have.
What is the default if you you do not specify anything in elogd.cfg? I assume it is /usr/local/elog otherwise it would not see the existing logbooks.
With a default Linux RPM install, where else would the logbooks be? Still looking for a 2020 directory on either server.
Bruce
Stefan Ritt wrote: |
You can put your files where ever you want, just tell elogd where to find the elogd.cfg file via the "-c" flag. Then tell elogd where to find files in the elogd.cfg file via the "Logbook dir" and "Resource dir" directives.
Stefan
VUIIS SysAdmin wrote: |
On the new server in the logbook that should have several 2020 entries it stops on the last entry of 2019.
On the old server after stopping elogd i get:
/usr/sbin/elogd -v 3
Cannot open "elogd.cfg": No such file or directory
Are the files supposed to be in /usr/local/elog or /usr/share/elog? I have both on the old server. I only synced /usr/local/elog to the new server. In any case the Logbook with 2020 entries does not show a 2020 directory.
My backup system also does not show any 2020 logbook directories. It was current up to this week when I started this process.
|
|
|
|
segfault in auth.c:366, posted by gary holman on Fri Apr 23 04:59:58 2021
|
Elog version: ELOG V3.1.4-611489ba
I am running openldap on the localhost. For some reason now, elogd is segfaulting when (I believe) when a new user is being added to the password file. For example:
1. I delete user passord file defined in elogd.cfg
2. Bind/Authenticate to LDAP successfully
3. Segfaults in auth.c ldap_adduser_file()
Makefile:
...
ELOGDIR = /opt/elog
DESTDIR = $(ROOT)$(PREFIX)/bin
SDESTDIR = $(ROOT)$(PREFIX)/sbin
RCDIR = $(ROOT)/etc/rc.d/init.d
SRVDIR = $(ROOT)/usr/lib/systemd/system
# flag for SSL support
USE_SSL = 1
# flag for Kerberos support, please turn off if you don't need Kerberos
USE_KRB5 = 0
# flag for LDAP support, please turn off if you don't need LDAP
USE_LDAP = 1# flag for PAM support, please turn of if you don't need PAM
USE_PAM = 0
...
For authentication, I am using openldap in the localhost:
----
Authentication = LDAP
LDAP server = ldap://localhost:389
LDAP userbase = ou=people,dc=example,dc=org
LDAP login attribute = uid
LDAP register = 1
Password file = /opt/elog/users
gdb output
----------
(gdb) run -s /opt/elog -c /opt/elog/elogd.cfg -f /var/run/elog/elog.pid
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/ubuntu/UPGRADE-42221/work-src/elog/elogd -s /opt/elog -c /opt/elog/elogd.cfg -f /var/run/elog/elog.pid
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
elogd 3.1.4 built Apr 22 2021, 19:19:39 revision 611489ba
File "/var/run/elog/elog.pid" exists, overwriting it.
CKeditor detected
ImageMagick detected
Indexing logbooks ... done
Server listening on port 9011 ...
Breakpoint 1, ldap_adduser_file (lbs=0x555556811ad8, user=0x7ffffffd3bd0 "testuser", password=0x5555558ea110 <_value+6000> "testuser", error_str=0x7ffffffd53d0 "", error_size=<optimized out>) at src/auth.c:350
350 if (rc != LDAP_SUCCESS) {
(gdb) n
337 rc = ldap_search_ext_s(
(gdb) n
350 if (rc != LDAP_SUCCESS) {
(gdb) n
358 for(entry = ldap_first_entry(ldap_ld,result);
(gdb) n
371 if(strcmp(attribute,"mail")==0 || strcmp(attribute,"rfc822Mailbox")==0)
(gdb) n
361 for(attribute = ldap_first_attribute(ldap_ld,entry,&ber);
(gdb) n
365 if((values = ldap_get_values(ldap_ld,entry,attribute)) != NULL ) {
(gdb) n
366 for(i=0; values[i] != NULL; i++) {
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
ldap_adduser_file (lbs=0x555556811ad8, user=0x7ffffffd3bd0 "testuser", password=0x5555558ea110 <_value+6000> "testuser", error_str=<optimized out>, error_size=<optimized out>) at src/auth.c:366
366 for(i=0; values[i] != NULL; i++) {
(gdb) p attribute
$1 = 0x5555567f6a20 "uid"
(gdb) p values
$2 = (char **) 0x567f74f0
This user in LDAP:
-------------------------
# TESTUSER, people, example.org
dn: uid=TESTUSER,ou=people,dc=example,dc=org
uid: TESTUSER
cn: TESTUSER
givenName: TESTUSER
sn:: VEVTVFVTRVIg
mail: TESTUSER
uidNumber: 10000
gidNumber: 10000
homeDirectory: /dev/null
objectClass: top
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
userPassword:: e1NTSEF9Y21ua1lsdFpMZ3ZrZlZ4OUp3MFN3cUY3NWIzdkFCSWY=
|
Re: segfault in auth.c:366, posted by Sebastian Schenk on Fri Apr 23 15:46:39 2021
|
Hi Mr. Holman,
The problem you are facing is more likely the issue, that the LDAP method is only provided as-is from a different developer.
I had a similar issue with the LDAP of my university.
I can't remember the correct error messages, but it looks similar, which arises from the used c library for LDAP.
The LDAP connection response can have 2 different variable types and only one of them is implemented in the elog, the other one crashes the elog with segfault.
I could fix it with this patch:
https://bitbucket.org/merrx/elog/commits/5a75fdb3e0b723380dae73bb57653946ed72690c
Obviously you have to adapt "displayName" and "postOfficeBox" to represent the name and email attributes of your LDAP structure.
I didn't made a PR for this commit, because it would break the current LDAP implementation, i assume.
Best wishes,
Sebastian
gary holman wrote: |
Elog version: ELOG V3.1.4-611489ba
I am running openldap on the localhost. For some reason now, elogd is segfaulting when (I believe) when a new user is being added to the password file. For example:
1. I delete user passord file defined in elogd.cfg
2. Bind/Authenticate to LDAP successfully
3. Segfaults in auth.c ldap_adduser_file()
Makefile:
...
ELOGDIR = /opt/elog
DESTDIR = $(ROOT)$(PREFIX)/bin
SDESTDIR = $(ROOT)$(PREFIX)/sbin
RCDIR = $(ROOT)/etc/rc.d/init.d
SRVDIR = $(ROOT)/usr/lib/systemd/system
# flag for SSL support
USE_SSL = 1
# flag for Kerberos support, please turn off if you don't need Kerberos
USE_KRB5 = 0
# flag for LDAP support, please turn off if you don't need LDAP
USE_LDAP = 1# flag for PAM support, please turn of if you don't need PAM
USE_PAM = 0
...
For authentication, I am using openldap in the localhost:
----
Authentication = LDAP
LDAP server = ldap://localhost:389
LDAP userbase = ou=people,dc=example,dc=org
LDAP login attribute = uid
LDAP register = 1
Password file = /opt/elog/users
gdb output
----------
(gdb) run -s /opt/elog -c /opt/elog/elogd.cfg -f /var/run/elog/elog.pid
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/ubuntu/UPGRADE-42221/work-src/elog/elogd -s /opt/elog -c /opt/elog/elogd.cfg -f /var/run/elog/elog.pid
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
elogd 3.1.4 built Apr 22 2021, 19:19:39 revision 611489ba
File "/var/run/elog/elog.pid" exists, overwriting it.
CKeditor detected
ImageMagick detected
Indexing logbooks ... done
Server listening on port 9011 ...
Breakpoint 1, ldap_adduser_file (lbs=0x555556811ad8, user=0x7ffffffd3bd0 "testuser", password=0x5555558ea110 <_value+6000> "testuser", error_str=0x7ffffffd53d0 "", error_size=<optimized out>) at src/auth.c:350
350 if (rc != LDAP_SUCCESS) {
(gdb) n
337 rc = ldap_search_ext_s(
(gdb) n
350 if (rc != LDAP_SUCCESS) {
(gdb) n
358 for(entry = ldap_first_entry(ldap_ld,result);
(gdb) n
371 if(strcmp(attribute,"mail")==0 || strcmp(attribute,"rfc822Mailbox")==0)
(gdb) n
361 for(attribute = ldap_first_attribute(ldap_ld,entry,&ber);
(gdb) n
365 if((values = ldap_get_values(ldap_ld,entry,attribute)) != NULL ) {
(gdb) n
366 for(i=0; values[i] != NULL; i++) {
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
ldap_adduser_file (lbs=0x555556811ad8, user=0x7ffffffd3bd0 "testuser", password=0x5555558ea110 <_value+6000> "testuser", error_str=<optimized out>, error_size=<optimized out>) at src/auth.c:366
366 for(i=0; values[i] != NULL; i++) {
(gdb) p attribute
$1 = 0x5555567f6a20 "uid"
(gdb) p values
$2 = (char **) 0x567f74f0
This user in LDAP:
-------------------------
# TESTUSER, people, example.org
dn: uid=TESTUSER,ou=people,dc=example,dc=org
uid: TESTUSER
cn: TESTUSER
givenName: TESTUSER
sn:: VEVTVFVTRVIg
mail: TESTUSER
uidNumber: 10000
gidNumber: 10000
homeDirectory: /dev/null
objectClass: top
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
userPassword:: e1NTSEF9Y21ua1lsdFpMZ3ZrZlZ4OUp3MFN3cUY3NWIzdkFCSWY=
|
|
Re: segfault in auth.c:366, posted by Stefan Ritt on Fri Apr 23 16:21:05 2021
|
Well, if you find a solution with works for everybody, I'm happy to commit it to the main repository. But unfortunately I cannot test it because I don't have LDAP here, so I'm flying blind.
Stefan |
Re: segfault in auth.c:366, posted by Laurent Jean-Rigaud on Sun Apr 25 15:17:27 2021
|
Hi,
Maybe it could be useful to add new parameters in elogd.cfg to define the attribute name to use to retrieve the given name, login name and email from LDAP server.
By example :
LDAP email attribute = mail
LDAP surname attribute = id
LDAP givename attribute = gn
So users can define them according to their exotic LDAP schema ;-)
Laurent |
|