klish server start failing with latest 3.0.0

242 views
Skip to first unread message

Saurabh Sarpal

unread,
Jan 13, 2023, 10:55:59 PM1/13/23
to klish
On `Ubuntu 20.04.5 LTS`, built the latest version `3.0.0`

git clone https://src.libcode.org/pkun/faux.git
cd faux
./autogen.sh && ./configure && make && sudo make install

cd ..
git clone https://src.libcode.org/pkun/klish.git
cd klish
./autogen.sh && ./configure && make && sudo make install


Trying to start the server ...

/usr/local/bin/klishd -d -v -f ./klishd.conf
klishd: Parse config file: ../klishd.conf
klishd: opts: Foreground = true
klishd: opts: Verbose = true
klishd: opts: LogFacility = daemon
klishd: opts: PIDPath = /var/run/klishd.pid
klishd: opts: ConfigPath = ../klishd.conf
klishd: opts: UnixSocketPath = /tmp/klish-unix-socket
klishd: opts: DBs = libxml2
klishd: Start daemon.
Scheme errors:
DB "libxml2": kdb-libxml2.so: cannot open shared object file: No such file or directory
DB "libxml2": Can't load DB plugin
klishd: Stop daemon.

Am I doing something wrong here?
Eventually I am trying to connect the client to the server.

serj.kalichev

unread,
Jan 16, 2023, 4:07:07 AM1/16/23
to kl...@googlegroups.com

Try:

for faux:

./configure --prefix=/usr ...

and for klish:

./configure --prefix=/usr --with-libxml2


14.01.2023 06:55, Saurabh Sarpal пишет:
--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish/15f33844-fe7c-49ab-89ac-e8b290c52265n%40googlegroups.com.

Saurabh Sarpal

unread,
Jan 16, 2023, 5:19:12 PM1/16/23
to klish
Thanks, that helped. Now it's hitting an assert failure ...

$ klishd -d -v -f ./klishd.conf
klishd: Parse config file: ./klishd.conf

klishd: opts: Foreground = true
klishd: opts: Verbose = true
klishd: opts: LogFacility = daemon
klishd: opts: PIDPath = /var/run/klishd.pid
klishd: opts: ConfigPath = ./klishd.conf

klishd: opts: UnixSocketPath = /tmp/klish-unix-socket
klishd: opts: DBs = libxml2
klishd: Start daemon.
klishd: Create listen UNIX socket: /tmp/klish-unix-socket
klishd: Listen socket 3

klishd: Service process for client was forked: 93068
klishd: klish/ktp/ktpd_session.c:84: ktpd_session_new: Assertion `ktpd->session' failed.
klishd: Service process 93068 was terminated by signal: 6


I ran klishd in gdb ...

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7d83859 in __GI_abort () at abort.c:79
#2  0x00007ffff7d83729 in __assert_fail_base (fmt=0x7ffff7f19588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=0x7ffff7fae553 "ktpd->session", file=0x7ffff7fae4f0 "klish/ktp/ktpd_session.c", line=84, function=<optimized out>)
    at assert.c:92
#3  0x00007ffff7d94fd6 in __GI___assert_fail (assertion=assertion@entry=0x7ffff7fae553 "ktpd->session",
    file=file@entry=0x7ffff7fae4f0 "klish/ktp/ktpd_session.c", line=line@entry=84,
    function=function@entry=0x7ffff7fae720 <__PRETTY_FUNCTION__.7277> "ktpd_session_new") at assert.c:101
#4  0x00007ffff7fa3015 in ktpd_session_new (sock=5, scheme=0x55555555ec80, start_entry=0x0, eloop=0x555555561390)
    at klish/ktp/ktpd_session.c:84
#5  0x000055555555705f in main (argc=<optimized out>, argv=<optimized out>) at bin/klishd/klishd.c:199


Also, found that in ksession_new(), since start_entry is NULL,
kscheme_find_entry_by_path() ends up looking for the main entry which it is not able to find.
Hence, it returns NULL but the caller expects something valid and asserts.

What am I missing here?

Serj Kalichev

unread,
Jan 28, 2023, 4:10:58 PM1/28/23
to kl...@googlegroups.com
Do you have VIEW with name "main"?
It's default view for klish3.


17.01.2023 01:19, Saurabh Sarpal пишет:

Saurabh Sarpal

unread,
Jan 30, 2023, 9:53:05 PM1/30/23
to klish
I am not sure. Where should I look?

As mentioned below, I started the server using the default klishd.conf that comes with the package ...
klishd -d -v -f ./klishd.conf

Serj Kalichev

unread,
Jan 31, 2023, 2:26:47 AM1/31/23
to kl...@googlegroups.com
Klish to work needs XML configuration (not klishd.conf) with commands definition. See examples within klish source tree. These config must be located in ~/.klish dir. Config must contain "VIEW" called "main".

31.01.2023 05:53, Saurabh Sarpal пишет:
Reply all
Reply to author
Forward
0 new messages