WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: lldpd not available for 16.x  (Read 1678 times)

Offline orneh24

  • Newbie
  • *
  • Posts: 10
lldpd not available for 16.x
« on: August 21, 2025, 08:02:59 PM »
Hi,
I was hoping to add lldpd to a TCL install, but could only find it available for 14.x:
http://tinycorelinux.net/14.x/x86_64/tcz/src/lldpd/

Will the lldpd app be made available for 16.x builds? Or is it possible to simply install the 14.x version, on top of a 16.x build?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12236
Re: lldpd not available for 16.x
« Reply #1 on: August 21, 2025, 08:30:16 PM »
Hi orneh24
Welcome to the forum.

Try downloading:
http://tinycorelinux.net/14.x/x86_64/tcz/lldpd.tcz
http://tinycorelinux.net/14.x/x86_64/tcz/lldpd.tcz.dep

Then:
Code: [Select]
tce-load -w libcap readline libxml2
tce-load -i lldpd
and see if it works.

If not, download the files at:
http://tinycorelinux.net/14.x/x86_64/tcz/src/lldpd/
into their own directory. Then:
Code: [Select]
chmod 775 lldpd.build
./lldpd.build
The first command makes  lldpd.build  executable.
The second command runs  lldpd.build.
When  lldpd.build  completes, you should have a complete set of
files for the  lldpd  extension.

Offline orneh24

  • Newbie
  • *
  • Posts: 10
Re: lldpd not available for 16.x
« Reply #2 on: August 21, 2025, 09:01:33 PM »
Thanks Rich  :)
Will give it a go right away.
Quick follow-up; would the same process be applicable for the net-snmp package from 15.x?
http://tinycorelinux.net/15.x/x86_64/tcz/src/net-snmp/

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12236
Re: lldpd not available for 16.x
« Reply #3 on: August 21, 2025, 09:15:43 PM »
Hi orneh24
net-snmp  is available in TC16 x86_64:
http://tinycorelinux.net/15.x/x86_64/tcz/net-snmp.tcz.info

Offline orneh24

  • Newbie
  • *
  • Posts: 10
Re: lldpd not available for 16.x
« Reply #4 on: August 21, 2025, 09:53:28 PM »
Then:
Code: [Select]
tce-load -w libcap readline libxml2
tce-load -i lldpd
and see if it works.
Looks like it's almost there;

Code: [Select]
tc@box:/tmp$ tce-load -w libcap readline libxml2
libcap.tcz.dep OK
Downloading: attr.tcz
readline.tcz.dep OK
Connecting to repo.tinycorelinux.net (128.127.66.77:80)
saving to 'attr.tcz'
attr.tcz             100% |*******************************************************************************************************************************************************************************************| 24576  0:00:00 ETA
'attr.tcz' saved
attr.tcz: OK
Downloading: libcap.tcz
libxml2.tcz.dep OK
Connecting to repo.tinycorelinux.net (128.127.66.77:80)
saving to 'libcap.tcz'
libcap.tcz           100% |*******************************************************************************************************************************************************************************************| 24576  0:00:00 ETA
'libcap.tcz' saved
libcap.tcz: OK
Downloading: readline.tcz
Connecting to repo.tinycorelinux.net (128.127.66.77:80)
saving to 'readline.tcz'
readline.tcz         100% |*******************************************************************************************************************************************************************************************|  144k  0:00:00 ETA
'readline.tcz' saved
readline.tcz: OK
Downloading: libxml2.tcz
Connecting to repo.tinycorelinux.net (128.127.66.77:80)
saving to 'libxml2.tcz'
libxml2.tcz          100% |*******************************************************************************************************************************************************************************************|  568k  0:00:00 ETA
'libxml2.tcz' saved
libxml2.tcz: OK

Code: [Select]
tc@box:/tmp$ tce-load -i lldpd
libxml2.tcz not found!

On a whim, I tried the following:
Code: [Select]
tc@box:/tmp$ tce-load -w libcap readline libxml2
libcap is already downloaded.
readline is already downloaded.
libxml2 is already downloaded.
tc@box:/tmp$ tce-load -i lldpd
libxml2.tcz not found!
tc@box:/tmp$ tce-load -wi libcap readline libxml2
libcap is already downloaded.
readline is already downloaded.
libxml2 is already downloaded.
attr.tcz: OK
libcap.tcz: OK
readline.tcz: OK
libxml2.tcz: OK
tc@box:/tmp$ tce-load -i lldpd
lldpd.tcz: OK

tc@box:/usr/bin$ lldpcli show neighbors
/usr/local/sbin/lldpcli: line 1: can't create *@@€^@8: Permission denied
/usr/local/sbin/lldpcli: line 1: A1+V]F$
                                        : not found
/usr/local/sbin/lldpcli: line 1: syntax error: unexpected word (expecting ")")

tc@box:/usr/bin$ sudo lldpcli show neighbors
/usr/local/sbin/lldpcli: line 1: can't open 8: no such file
/usr/local/sbin/lldpcli: line 1: A1+V]F$
                                        : not found
/usr/local/sbin/lldpcli: line 1: syntax error: unexpected word (expecting ")")

Will take a look at the build method, to see if that works (although let me know if you spot anything incorrect in what I did above)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12236
Re: lldpd not available for 16.x
« Reply #5 on: August 21, 2025, 11:35:09 PM »
Hi orneh24
I've never used lldpd, but it appears like you may need to run it as root:
Code: [Select]
sudo su
lldpcli show neighbors

Offline orneh24

  • Newbie
  • *
  • Posts: 10
Re: lldpd not available for 16.x
« Reply #6 on: August 22, 2025, 01:33:41 AM »
Running as root returned the same errors - so I tried the build method instead (should note, I've never compiled anything myself before, so this is somewhat uncharted territory for me)

The build script seems to have completed successfully:
Code: [Select]
tc@lldpdboxtest:~/ll$ ls -l
total 8548
drwxr-sr-x 2 tc staff     480 Aug 22 05:18 i686/
drwxr-sr-x 9 tc staff     720 Aug 22 05:18 lldpd-1.0.18/
-rw-r--r-- 1 tc staff 1988753 Aug 22 05:17 lldpd-1.0.18.tar.gz
-rw-rw-r-- 1 tc staff  688128 Aug 22 05:18 lldpd-dev.tcz
-rw-r--r-- 1 tc staff      10 Aug 22 05:18 lldpd-dev.tcz.dep
-rw-r--r-- 1 tc staff     882 Aug 22 05:18 lldpd-dev.tcz.info
-rw-r--r-- 1 tc staff     125 Aug 22 05:18 lldpd-dev.tcz.list
-rw-r--r-- 1 tc staff      48 Aug 22 05:18 lldpd-dev.tcz.md5.txt
-rw-r--r-- 1 tc staff    2211 Aug 22 05:18 lldpd-dev.tcz.zsync
-rw-rw-r-- 1 tc staff   20480 Aug 22 05:18 lldpd-doc.tcz
-rw-r--r-- 1 tc staff     881 Aug 22 05:18 lldpd-doc.tcz.info
-rw-r--r-- 1 tc staff     106 Aug 22 05:18 lldpd-doc.tcz.list
-rw-r--r-- 1 tc staff      48 Aug 22 05:18 lldpd-doc.tcz.md5.txt
-rw-r--r-- 1 tc staff     244 Aug 22 05:18 lldpd-doc.tcz.zsync
-rw-r--r-- 1 tc staff 2887974 Aug 22 05:18 lldpd-i686.tar.gz.bfe
-rw-r--r-- 1 tc staff 1991705 Aug 22 05:18 lldpd-source-v1.0.18.tar.gz
-rwxrwxr-x 1 tc staff    9301 Aug 22 05:17 lldpd.build
-rw-r--r-- 1 tc staff  893303 Aug 22 05:18 lldpd.tar.gz
-rw-rw-r-- 1 tc staff  188416 Aug 22 05:18 lldpd.tcz
-rw-r--r-- 1 tc staff      36 Aug 22 05:18 lldpd.tcz.dep
-rw-r--r-- 1 tc staff     878 Aug 22 05:18 lldpd.tcz.info
-rw-r--r-- 1 tc staff     480 Aug 22 05:18 lldpd.tcz.list
-rw-r--r-- 1 tc staff      44 Aug 22 05:18 lldpd.tcz.md5.txt
-rw-r--r-- 1 tc staff     739 Aug 22 05:18 lldpd.tcz.zsync
drwxr-xr-x 3 tc staff      60 Aug 22 05:18 lldpd_all/
drwxr-sr-x 3 tc staff      60 Aug 22 05:18 lldpd_dev/
drwxr-sr-x 3 tc staff      60 Aug 22 05:18 lldpd_doc/
drwxr-sr-x 3 tc staff      60 Aug 22 05:18 lldpd_ext/
-rw-r--r-- 1 tc staff    8435 Aug 22 05:18 submitqc.txt

But seems to be a problem with either creating the socket or a _lldpd user;
Code: [Select]
tc@lldpdboxtest:~/ll$ lldpcli
2025-08-22T05:26:53 [WARN/control] unable to connect to socket /var/run/lldpd.socket: No such file or directory

tc@lldpdboxtest:~/ll$ sudo lldpd -dddd
2025-08-22T05:31:13 [ DBG/main] lldpd 1.0.18 starting...
2025-08-22T05:31:13 [CRIT/main] no _lldpd user for privilege separation, please create it

Will try to dig a bit further and see if I can make it work

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12236
Re: lldpd not available for 16.x
« Reply #7 on: August 22, 2025, 02:40:06 PM »
Hi orneh24
It looks like you need to create an _lldpd  user and group.
Try this:
Code: [Select]
sudo su
addgroup _lldpd
adduser -H -S -s /bin/sh -G _lldpd -D _lldpd
echo -e "_lldpd\tALL=NOPASSWD: ALL" >> /etc/sudoers
exit

Then see if this command behaves any better:
Code: [Select]
sudo lldpd -dddd
If it does, then:
Code: [Select]
echo "etc/group" >> /opt/.filetool.lst
echo "etc/gshadow" >> /opt/.filetool.lst
echo "etc/passwd" >> /opt/.filetool.lst
echo "etc/shadow" >> /opt/.filetool.lst
echo "etc/sudoers" >> /opt/.filetool.lst
filetool.sh -b

Offline orneh24

  • Newbie
  • *
  • Posts: 10
Re: lldpd not available for 16.x
« Reply #8 on: August 22, 2025, 03:36:21 PM »
Thanks Rich, appreciate the help.
Will try out the commands later tonight.

Offline orneh24

  • Newbie
  • *
  • Posts: 10
Re: lldpd not available for 16.x
« Reply #9 on: August 22, 2025, 06:28:41 PM »
Allright, so after adding the group and user, lldpd successfully starts  :)

Code: [Select]
tc@nginxsnmptcl:/home$ sudo lldpd -dddd
2025-08-22T22:04:27 [ DBG/main] lldpd 1.0.18 starting...
2025-08-22T22:04:27 [ DBG/main] creating control socket
2025-08-22T22:04:27 [ DBG/control] create control socket /var/run/lldpd.socket
2025-08-22T22:04:27 [ DBG/control] listen to control socket /var/run/lldpd.socket
2025-08-22T22:04:27 [ DBG/main] invoking lldpcli for default configuration locations
2025-08-22T22:04:27 [ DBG/main] invoke /usr/local/sbin/lldpcli -sddd
2025-08-22T22:04:27 [ DBG/main] get OS/LSB release information
2025-08-22T22:04:27 [ DBG/localchassis] grab OS release
2025-08-22T22:04:27 [ DBG/main] initialize privilege separation
2025-08-22T22:04:27 [ DBG/privsep] getting CAP_NET_RAW/ADMIN and CAP_DAC_OVERRIDE privilege
2025-08-22T22:04:27 [ DBG/privsep] dropping privileges
2025-08-22T22:04:27 [ DBG/privsep] dropping extra capabilities
2025-08-22T22:04:27 [ DBG/main] invoke /usr/local/sbin/lldpcli -sddd
2025-08-22T22:04:27 [ DBG/lldpctl] cannot find configuration file/directory /usr/local/etc/lldpd.conf
2025-08-22T22:04:27 [ DBG/privsep] dropping privileges
2025-08-22T22:04:27 [ DBG/privsep] received command 0
2025-08-22T22:04:27 [ DBG/privsep] monitor ready
... rest of debug output omitted

Socket is succesfully created:
Code: [Select]
tc@nginxsnmptcl:/$ ll /var/run
total 20
drwxr-xr-x    2 root     root            40 Aug 22 22:02 lldpd/
-rw-r--r--    1 root     root             5 Aug 22 22:07 lldpd.pid
srwxrwx---    1 _lldpd   _lldpd           0 Aug 22 22:07 lldpd.socket
-rwxrwx---    1 _lldpd   _lldpd           0 Aug 22 22:07 lldpd.socket.lock
-rw-r--r--    1 root     root             5 Aug 22 21:59 nginx.pid
-rw-r--r--    1 root     root             5 Aug 22 21:59 sshd.pid
-rw-rw-r--    1 root     staff          768 Aug 22 21:59 utmp
dr-xr-xr-x    3 root     root          4096 Aug 22 22:11 vmblock-fuse/
-rw-r--r--    1 root     root             5 Aug 22 21:59 vmtoolsd.pid
tc@nginxsnmptcl:/$

And lldpcli/lldpctl output is correct:
Code: [Select]
tc@nginxsnmptcl:/home$ sudo lldpcli show neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    eth0, via: LLDP, RID: 1, Time: 0 day, 00:01:35
  Chassis:     
    ChassisID:    mac 1c:e8:5d:d5:39:00
    SysName:      C3560G
    SysDescr:     Cisco IOS Software, C3560C Software (C3560c405ex-UNIVERSALK9-M), Version 15.2(2)E4, RELEASE SOFTWARE (fc2)
                  Technical Support: http://www.cisco.com/techsupport
                  Copyright (c) 1986-2016 by Cisco Systems, Inc.
                  Compiled Sat 13-Feb-16 02:28 by prod_rel_team
    MgmtIP:       192.168.2.2
    Capability:   Bridge, on
    Capability:   Router, on
  Port:       
    PortID:       ifname Gi0/7
    PortDescr:    ESXi01_vmnic1_dvswitch
    TTL:          120

I believe the only thing missing now, is the init.d/lldpd and making the lldpd package installation persistent (or rather, what would be the correct way, of making it persistent after building it locally)?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12236
Re: lldpd not available for 16.x
« Reply #10 on: August 22, 2025, 08:16:32 PM »
Hi orneh24
... I believe the only thing missing now, is the init.d/lldpd ...
I'll look into that.

Quote
... and making the lldpd package installation persistent (or rather, what would be the correct way, of making it persistent after building it locally)?
I'm assuming you used the build script, so copy lldpd.tcz, lldpd.tcz.dep, and lldpd.tcz.md5.txt
to your  tce/optional directory.

Make sure  lldpd.tcz  is listed in  onboot.lst.

If you followed these instructions:
...
Code: [Select]
echo "etc/group" >> /opt/.filetool.lst
echo "etc/gshadow" >> /opt/.filetool.lst
echo "etc/passwd" >> /opt/.filetool.lst
echo "etc/shadow" >> /opt/.filetool.lst
echo "etc/sudoers" >> /opt/.filetool.lst
filetool.sh -b
then the added  _lldpd  user and group will survive a reboot.

Offline orneh24

  • Newbie
  • *
  • Posts: 10
Re: lldpd not available for 16.x
« Reply #11 on: August 22, 2025, 08:17:03 PM »
ref. persistency - copied lldpd.tcz, .tcz.dep and .tcz.md5.txt to /mnt/sda1/tce/optional and added lldpd to onboot.lst.

Currently trying to understand how TCL handles init.d - are the files in /usr/local/etc/init.d/ just symlinks to /tmp/tcloop/ ? I tried taking a look at the Wiki, but couldn't quite find the info.
Code: [Select]
tc@nginxsnmptcl:/usr/local/etc/init.d$ ll
total 0
lrwxrwxrwx    1 root     root            42 Aug 23 00:09 fuse -> /tmp/tcloop/fuse/usr/local/etc/init.d/fuse
lrwxrwxrwx    1 root     root            44 Aug 23 00:09 nginx -> /tmp/tcloop/nginx/usr/local/etc/init.d/nginx
lrwxrwxrwx    1 root     root            60 Aug 23 00:09 open-vm-tools -> /tmp/tcloop/open-vm-tools/usr/local/etc/init.d/open-vm-tools
lrwxrwxrwx    1 root     root            48 Aug 23 00:09 openssh -> /tmp/tcloop/openssh/usr/local/etc/init.d/openssh

Edit; sorry Rich, didn't see your reply before posting this one. Yes, I did indeed also add the group, gshadow, passwd, shadow and sudoers file to .filetool.lst.
« Last Edit: August 22, 2025, 08:20:55 PM by orneh24 »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12236
Re: lldpd not available for 16.x
« Reply #12 on: August 22, 2025, 08:22:35 PM »
Hi orneh24
... are the files in /usr/local/etc/init.d/ just symlinks to /tmp/tcloop/ ? ...
Yes, they are.

Extensions are read-only file systems that get mounted under /tmp/tcloop/.
Their contents then get symlinked into the system directories.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 771
Re: lldpd not available for 16.x
« Reply #13 on: August 23, 2025, 02:51:47 AM »
Hi @orneh24.
If you want, you can also make a script that will add the user and group when the user installing the extension.
Se this wiki page how to do it.
https://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#adding_custom_startup_scripts

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12236
Re: lldpd not available for 16.x
« Reply #14 on: August 23, 2025, 09:07:56 PM »
Hi orneh24
Sorry for the delay. I started by trying to modify an existing
init.d/lldpd  script from another distro. It proved to be too
complicated, so I adapted our  init.d/dbus  script:
Code: [Select]
#!/bin/sh

NAME=lldpd
DAEMON="/usr/local/sbin/$NAME"
DAEMON_ARGS=""


start()
{
start-stop-daemon -S -x "$DAEMON" -- "$DAEMON_ARGS"
}

stop()
{
start-stop-daemon -K -x "$DAEMON" 2>/dev/null
rm -rf /var/run/"$NAME"*
}



status()
{
if [ -e /var/run/"$NAME".pid ]; then
echo -e "\n$NAME is running.\n"
exit 0
else
echo -e "\n$NAME is not running.\n"
exit 1
fi
}

case $1 in
start) start
;;
stop) stop
;;
status) status
;;
restart) stop; start
;;
*) echo -e "\n$0 [start|stop|restart|status]\n"
;;
esac

Under  stop() , I've included a command to remove all lldpd
files and directories in case lldpd does not clean up after
itself when stopped:
Code: [Select]
drwxr-xr-x    2 root     root            40 Aug 22 22:02 lldpd/
-rw-r--r--    1 root     root             5 Aug 22 22:07 lldpd.pid
srwxrwx---    1 _lldpd   _lldpd           0 Aug 22 22:07 lldpd.socket
-rwxrwx---    1 _lldpd   _lldpd           0 Aug 22 22:07 lldpd.socket.lock

Attachment deleted. See next post.
« Last Edit: August 24, 2025, 10:38:50 AM by Rich »