diff --git a/docs/building.md b/docs/building.md new file mode 100644 index 0000000..2be87b0 --- /dev/null +++ b/docs/building.md @@ -0,0 +1,51 @@ +# Building the cc-metric-collector + +In most cases, a simple `make` in the main folder is enough to get a `cc-metric-collector` binary. It is basically a `go build` but some collectors require additional tasks. There is currently no Golang interface to LIKWID, so it uses `cgo` to create bindings but `cgo` requires the LIKWID header files. Therefore, it checks whether LIKWID is installed and if not it downloads LIKWID and copies the headers. + +## System integration + +The main configuration settings for system integration are pre-defined in `scripts/cc-metric-collector.config`. The file contains the UNIX user and group used for execution, the PID file location and other settings. Adjust it accordingly and copy it to `/etc/default/cc-metric-collector` + +``` +$ install -m 644 scripts/cc-metric-collector.config /etc/default/cc-metric-collector +$ edit /etc/default/cc-metric-collector +``` + +### SysVinit and similar + +If you are using a init system based in `/etc/init.d` daemons, you can use the sample `scripts/cc-metric-collector.init`. It reads the basic configuration from `/etc/default/cc-metric-collector` + +``` +$ install -m 755 scripts/cc-metric-collector.init /etc/init.d/cc-metric-collector +``` + +### Systemd + +If you are using `systemd` as init system, you can use the sample systemd service file `scripts/cc-metric-collector.service`, the configuration file `scripts/cc-metric-collector.config`. + +``` +$ install -m 644 scripts/cc-metric-collector.service /etc/systemd/system/cc-metric-collector.service +$ systemctl enable cc-metric-collector +``` + +## RPM + +In order to get a RPM packages for cc-metric-collector, just use: + +``` +$ make RPM +``` + +It uses the RPM SPEC file `scripts/cc-metric-collector.spec` and requires the RPM tools (`rpm` and `rpmspec`) and `git`. + +## DEB + +In order to get very simple Debian packages for cc-metric-collector, just use: + +``` +$ make DEB +``` + +It uses the DEB control file `scripts/cc-metric-collector.control` and requires `dpkg-deb`, `awk`, `sed` and `git`. It creates only a binary deb package. + +_This option is not well tested and therefore experimental_ \ No newline at end of file