Skip to content

Commit 2b5cf29

Browse files
committed
statd: Add new README to describe statd
Whats required from your system and what to expect when you run it outside Infix.
1 parent 513c03a commit 2b5cf29

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

src/statd/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Introduction
2+
Statd is designed to be integrated into Infix and supply the operational
3+
database with data. To do this it uses companion binaries written in
4+
python, these are located in the `python` directory.
5+
6+
7+
## Run outside Infix
8+
### Prerequisites
9+
There are some requirements set on your computer to run statd locally.
10+
11+
- An Ubuntu based system
12+
- lldpd
13+
- python3
14+
- [libite](https://github.com/troglobit/libite)
15+
- [libsrx](https://github.com/kernelkit/infix/tree/main/src/libsrx)
16+
- python-poetry
17+
- [sysrepo](https://github.com/sysrepo/sysrepo) (At least the same version as Infix)
18+
- [libyang](https://github.com/CESNET/libyang) (At least the same version as Infix)
19+
20+
21+
### Install YANG modules in local sysrepo
22+
This requires that you first build Infix, since netopeer2 and sysrepo are responsible
23+
for installing their own YANG files.
24+
25+
```bash
26+
user@host ~/infix$ export TARGET_DIR="output/target/"
27+
user@host ~/infix$ export NETOPEER2_SEARCHPATH=$TARGET_DIR/usr/share/yang/modules/netopeer2/
28+
user@host ~/infix$ export SYSREPO_SEARCHPATH=$TARGET_DIR/usr/share/yang/modules/sysrepo/
29+
user@host ~/infix$ export LIBNETCONF2_SEARCHPATH=$TARGET_DIR/usr/share/yang/modules/libnetconf2/
30+
user@host ~/infix$ export CONFD_SEARCHPATH=$TARGET_DIR/usr/share/yang/modules/confd/
31+
user@host ~/infix$ export TEST_MODE_SEARCHPATH=$TARGET_DIR/usr/share/yang/modules/test-mode/
32+
user@host ~/infix$ export ROUSETTE_SEARCHPATH=$TARGET_DIR/usr/share/yang/modules/rousette/
33+
user@host ~/infix$ export SEARCH_PATH="$NETOPEER2_SEARCHPATH $SYSREPO_SEARCHPATH $LIBNETCONF2_SEARCHPATH $CONFD_SEARCHPATH $TEST_MODE_SEARCHPATH $ROUSETTE_SEARCHPATH"
34+
35+
user@host ~/infix$ ./utils/srload src/confd/yang/sysrepo.inc
36+
user@host ~/infix$ ./utils/srload src/confd/yang/libnetconf2.inc
37+
user@host ~/infix$ ./utils/srload src/confd/yang/netopeer2.inc
38+
user@host ~/infix$ ./utils/srload src/confd/yang/confd.inc
39+
user@host ~/infix$ ./utils/srload src/confd/yang/rousette.inc
40+
user@host ~/infix$ ./utils/srload src/confd/yang/test-mode.inc
41+
```
42+
43+
### Build and install python companion binaries
44+
```bash
45+
user@host ~/infix/src/statd/python$ ./local_install.sh
46+
```
47+
This will install the binaries in ~/.local/bin
48+
49+
### Build and install statd
50+
51+
```bash
52+
user@host ~/infix/src/statd$ ./configure --with-yanger-dir=$HOME/.local/bin
53+
user@host ~/infix/src/statd$ make
54+
user@host ~/infix/src/statd$ sudo make install
55+
```
56+
57+
### Running statd
58+
Since the `yanger` binary, for example, reads the shadow database, you
59+
can expect different results if running `statd` as root or not.
60+
```bash
61+
user@host ~/infix/src/statd$ statd
62+
```

0 commit comments

Comments
 (0)