systemd
Toolchain, once per machine
Section titled “Toolchain, once per machine”rustup toolchain install nightly --component rust-srcrustc +nightly --version --verbose | grep LLVM # note the major version, 23 here
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 23LLVM_SYS_231_PREFIX=/usr/lib/llvm-23 PATH=/usr/lib/llvm-23/bin:$PATH \ cargo install bpf-linker --lockedjust runs the recipes: cargo install just or the distribution package.
Build and install
Section titled “Build and install”cd croftjust build-releasesudo install -m 0755 collector/target/release/croft /usr/local/bin/croftsudo cp deploy/systemd/croft-collector.service /etc/systemd/system/sudo systemctl daemon-reloadsudo systemctl enable --now croft-collector
journalctl -u croft-collector -fThe dataset lands in /var/lib/croft/croft-dataset.jsonl. Set variables with Environment= lines in the unit, for example Environment=WATCH_CGROUPS=docker.
Try it without installing
Section titled “Try it without installing”just run builds a debug binary and runs it under sudo in the foreground, writing to the same file, so croft top and croft stats read it without --dataset.
Upgrade
Section titled “Upgrade”git pulljust build-releasesudo install -m 0755 collector/target/release/croft /usr/local/bin/croftsudo systemctl restart croft-collectorRemove
Section titled “Remove”sudo systemctl disable --now croft-collectorsudo rm /etc/systemd/system/croft-collector.service /usr/local/bin/croftsudo systemctl daemon-reload/var/lib/croft keeps the dataset.