#1 Update to 3.6
Merged a month ago by piotrp. Opened a month ago by ignatenkobrain.
rpms/ ignatenkobrain/carbon-c-relay 3.6.x  into  master

file modified
+1

@@ -25,3 +25,4 @@ 

  /carbon-c-relay-b785959.tar.gz

  /carbon-c-relay-2d34f86.tar.gz

  /carbon-c-relay-20dd600.tar.gz

+ /carbon-c-relay-3.6.tar.gz

file removed
-101

@@ -1,101 +0,0 @@ 

- #!/bin/bash

- #

- # /etc/rc.d/init.d/carbon-c-relay

- #

- # relay    Startup script for the carbon-c-relay metrics aggregation daemon

- # Packaged for the BBC by Matthew Hollick <matthew@mayan-it.co.uk>

- #

- # description: Carbon-like graphite line mode relay.

- #

- #This project aims to be a replacement of the original Carbon relay

- #

- #The main reason to build a replacement is performance and configurability.

- #Carbon is single threaded, and sending metrics to multiple consistent-hash

- #clusters requires chaining of relays. This project provides a multithreaded

- #relay which can address multiple targets and clusters for each and every

- #metric based on pattern matches.

- #

- # chkconfig: 2345 80 80

- #

- # config: /etc/carbon-c-relay.conf

- # pidfile: /var/run/carbon-c-relay/carbon-c-relay.pid

- 

- # Source function library.

- . /etc/init.d/functions

- 

- 

- RETVAL=0

- PROG="carbon-c-relay"

- DAEMON_CONFIG=/etc/${PROG}.conf

- DAEMON_SYSCONFIG=/etc/sysconfig/${PROG}

- DAEMON=/usr/bin/${PROG}

- PID_FILE=/var/run/${PROG}/${PROG}.pid

- LOCK_FILE=/var/lock/subsys/${PROG}

- LOG_FILE=/var/log/${PROG}/${PROG}.log

- DAEMON_USER="${PROG}"

- 

- . ${DAEMON_SYSCONFIG}

- 

- start() {

-     if check_status > /dev/null; then

-         echo "Carbon C Relay is already running"

-         exit 0

-     fi

- 

-     echo -n $"Starting Carbon C Relay: "

-     daemon --user ${DAEMON_USER} ${DAEMON} -P ${PID_FILE} -D ${ARGS} -f ${DAEMON_CONFIG}

-     RETVAL=${?}

-     echo

-     [ ${RETVAL} -eq 0 ] && touch ${LOCK_FILE}

-     return ${RETVAL}

- }

- 

- stop() {

-     echo -n $"Stopping Carbon C Relay: "

-     killproc -p ${PID_FILE} -d 10 ${DAEMON}

-     RETVAL=${?}

-     echo

-     [ ${RETVAL} = 0 ] && rm -f ${LOCK_FILE}

-     return ${RETVAL}

- }

- 

- check_status() {

-     status -p ${PID_FILE} ${DAEMON}

-     RETVAL=${?}

-     return ${RETVAL}

- }

- 

- reload() {

-     echo -n $"Reloading Carbon C Relay "

-     killproc -p ${PID_FILE} ${DAEMON} -HUP

-     RETVAL=${?}

-     echo

-     return ${RETVAL}

- }

- 

- 

- case "${1}" in

-     start)

-         start

-         ;;

-     stop)

-         stop

-         ;;

-     status)

-         check_status

-         ;;

-     reload|force-reload)

-         reload

-         ;;

-     restart)

-         stop

-         start

-         ;;

-     *)

-         N=/etc/init.d/${PROG}

-         echo "Usage: ${N} {start|stop|status|restart|force-reload}" >&2

-         RETVAL=2

-         ;;

- esac

- 

- exit ${RETVAL}

@@ -1,12 +0,0 @@ 

- # If you need to change execution environment configuration (e.g. limits) you

- # can set it below. Don't forget to run `systemctl daemon-reload` and

- # `systemctl restart carbon-c-relay` to make your changes effective.

- #

- # See "man systemd.exec" for information.

- 

- # For example, to increase the maximum number of file descriptors (open

- # connections) uncomment following lines.

- #

- #[Service]

- #LimitNOFILE=4096

- 

@@ -1,11 +0,0 @@ 

- /var/log/carbon-c-relay/carbon-c-relay.log

- {

-   sharedscripts

-   missingok

-   notifempty

-   rotate 30

-   compress

-   postrotate

-     [ ! -f /var/run/carbon-c-relay/carbon-c-relay.pid ] || /bin/kill -HUP $(cat /var/run/carbon-c-relay/carbon-c-relay.pid)

-   endscript

- }

file modified
-12

@@ -1,14 +1,3 @@ 

- # It's not recommended to modify this file in-place, because it will be

- # overwritten during package upgrades. The best way to customize unit files is

- # to add a file with suffix ".conf" to

- # /etc/systemd/system/carbon-c-relay.service.d/

- #

- # For example, if you want to increase carbon-c-relay's open-files-limit to

- # 10000, you need to increase systemd's LimitNOFILE setting in:

- # "/etc/systemd/system/carbon-c-relay.service.d/limits.conf" containing:

- # [Service]

- # LimitNOFILE=10000

- 

  [Unit]

  Description=Enhanced C implementation of Carbon relay, aggregator and rewriter

  After=network.target

@@ -23,4 +12,3 @@ 

  

  [Install]

  WantedBy=multi-user.target

- 

file modified
+55 -104

@@ -1,110 +1,92 @@ 

- %global _hardened_build 1

- 

- %ifarch %{nodejs_arches}

- %global build_manpage 1

- %endif

- 

- %global commit0 20dd60013e39e6b2de66635ff7df5bf239f33c97

- %global shortcommit0 %(c=%{commit0}; echo ${c:0:7})

- 

  Name:               carbon-c-relay

- Version:            3.4

- Release:            3%{?dist}

+ Version:            3.6

+ Release:            1%{?dist}

  Summary:            Enhanced C implementation of Carbon relay, aggregator and rewriter

  License:            ASL 2.0

  URL:                https://github.com/grobian/carbon-c-relay

- Source0:            https://github.com/grobian/%{name}/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz

+ Source0:            %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

  Source1:            carbon-c-relay.service

- Source2:            carbon-c-relay.init

- Source3:            carbon-c-relay.logrotate

- Source4:            carbon-c-relay.sysconfig.sysv

- Source5:            carbon-c-relay.conf

- Source6:            carbon-c-relay.sysconfig.systemd

- Source7:            carbon-c-relay.limits.systemd

+ Source2:            carbon-c-relay.conf

+ Source3:            carbon-c-relay.sysconfig.systemd

  

+ BuildRequires:      autoconf

+ BuildRequires:      automake

+ BuildRequires:      libtool

  BuildRequires:      gcc

  BuildRequires:      make

  BuildRequires:      bison

  BuildRequires:      flex

- 

- # use nodejs-ronn instead of ruby ronn because of availability on epel 6 & 7

- %if 0%{?build_manpage}

- BuildRequires:      nodejs-ronn

+ %if ! (0%{?rhel} && 0%{?rhel} <= 7)

+ BuildRequires:      /usr/bin/ronn

+ BuildRequires:      pcre2-devel

+ %else

+ BuildRequires:      pcre-devel

  %endif

+ BuildRequires:      zlib-devel

+ BuildRequires:      lz4-devel

+ BuildRequires:      openssl-devel

  

  Requires(pre):      shadow-utils

  

- %if 0%{?rhel} && 0%{?rhel} <= 6

- Requires(post):     chkconfig

- Requires(preun):    chkconfig

- Requires(postun):   initscripts

- %else

+ %if 0%{?rhel} && 0%{?rhel} <= 7

  BuildRequires:      systemd

- Requires(post):     systemd

- Requires(preun):    systemd

- Requires(postun):   systemd

+ %else

+ BuildRequires:      systemd-rpm-macros

  %endif

  

  # carbon-c-relay ships a bundled md5 library for which an exception exists

  # see: https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries

  Provides:           bundled(md5-peslyak)

  

- # Does not build on old 32bit architectures (el5)

- # https://github.com/grobian/carbon-c-relay/issues/100

- ExcludeArch:        i386 ppc

- 

- 

  %description

- Carbon-like Graphite line mode relay. This project aims to be a replacement of 

- the original Carbon relay. The main reason to build a replacement is 

- performance and configurability. Carbon is single threaded, and sending 

- metrics to multiple consistent-hash clusters requires chaining of relays. This 

- project provides a multithreaded relay which can address multiple targets and 

+ Carbon-like Graphite line mode relay. This project aims to be a replacement of

+ the original Carbon relay. The main reason to build a replacement is

+ performance and configurability. Carbon is single threaded, and sending

+ metrics to multiple consistent-hash clusters requires chaining of relays. This

+ project provides a multithreaded relay which can address multiple targets and

  clusters for each and every metric based on pattern matches.

  

- 

  %prep

- %autosetup -n %{name}-%{commit0}

- 

+ %autosetup

  # remove pregenerated bison and flex files

  rm conffile.tab.c conffile.tab.h conffile.yy.c

  

- 

  %build

- %configure

- %make_build LDFLAGS="%{?__global_ldflags}" CFLAGS="%{optflags}"

- 

- %if 0%{?build_manpage}

- ronn-nodejs --roff carbon-c-relay.md > carbon-c-relay.1

+ autoreconf -vfi

+ %configure \

+   --with-gzip \

+   --with-lz4 \

+   --with-snappy=no \

+   --with-ssl \

+   --with-oniguruma=no \

+ %if 0%{?rhel} && 0%{?rhel} <= 7

+   --with-pcre2=no \

+   --with-pcre \

+ %else

+   --with-pcre2 \

+   --with-pcre=no \

  %endif

+   %{nil}

+ %make_build

  

+ %if ! (0%{?rhel} && 0%{?rhel} <= 7)

+ ronn --roff carbon-c-relay.md > carbon-c-relay.1

+ %else

+ cp -a relay.1 carbon-c-relay.1

+ %endif

  

  %install

  install -Dp -m0755 relay %{buildroot}%{_bindir}/%{name}

- install -Dp -m0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/%{name}.conf

+ install -Dp -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}.conf

  

- %if 0%{?build_manpage}

  install -Dp -m0644 carbon-c-relay.1 %{buildroot}%{_mandir}/man1/carbon-c-relay.1

- %endif

  

- %if 0%{?rhel} && 0%{?rhel} <= 6

- mkdir -p %{buildroot}%{_localstatedir}/log/%{name}

- mkdir -p %{buildroot}%{_localstatedir}/run/%{name}

- mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d

- install -Dp -m0755 %{SOURCE2} %{buildroot}%{_initddir}/%{name}

- install -Dp -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

- install -Dp -m0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/%{name}

- %else

  install -Dp -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service

- install -Dp -m0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/%{name}

- install -Dp -m0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limits.conf

- %endif

- 

+ install -Dp -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}

  

  %check

  make test

  

- 

  %pre

  getent group carbon-c-relay >/dev/null || groupadd -r carbon-c-relay

  getent passwd carbon-c-relay >/dev/null || \

@@ -112,63 +94,32 @@ 

      -c "Carbon C Relay Daemon" carbon-c-relay

  exit 0

  

- 

  %post

- %if 0%{?rhel} && 0%{?rhel} <= 6

- /sbin/chkconfig --add %{name}

- %else

  %systemd_post %{name}.service

- %endif

- 

  

  %preun

- %if 0%{?rhel} && 0%{?rhel} <= 6

- if [ $1 -eq 0 ] ; then

-     /sbin/service %{name} stop >/dev/null 2>&1

-     /sbin/chkconfig --del %{name}

- fi

- %else

  %systemd_preun %{name}.service

- %endif

- 

  

  %postun

- %if 0%{?rhel} && 0%{?rhel} <= 6

- if [ "$1" -ge "1" ] ; then

-     /sbin/service %{name} condrestart >/dev/null 2>&1 || :

- fi

- %else

  %systemd_postun_with_restart %{name}.service

- %endif

- 

  

  %files

- %{!?_licensedir:%global license %%doc}

  %license LICENSE.md

  %doc carbon-c-relay.md ChangeLog.md

- 

- %if 0%{?build_manpage}

- %{_mandir}/man1/carbon-c-relay.1*

- %endif

- 

  %{_bindir}/carbon-c-relay

+ %{_mandir}/man1/carbon-c-relay.1*

  %config(noreplace) %{_sysconfdir}/carbon-c-relay.conf

  %config(noreplace) %{_sysconfdir}/sysconfig/carbon-c-relay

- 

- 

- %if 0%{?rhel} && 0%{?rhel} <= 6

- %{_initddir}/%{name}

- %attr(0755,carbon-c-relay,carbon-c-relay) %dir %{_localstatedir}/log/%{name}

- %attr(0755,carbon-c-relay,carbon-c-relay) %dir %{_localstatedir}/run/%{name}

- %{_sysconfdir}/logrotate.d/%{name}

- %else

  %{_unitdir}/%{name}.service

- %dir %{_sysconfdir}/systemd/system/%{name}.service.d

- %config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/limits.conf

- %endif

- 

  

  %changelog

+ * Wed Jan 22 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 3.6-1

+ - Update to 3.6

+   + Enable gzip compression support

+   + Enable lz4 compression support

+   + Enable SSL support

+   + Simplify systemd configuration

+ 

  * Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.4-3

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

  

@@ -1,31 +1,26 @@ 

- # Fedora/EPEL7: Logs are sent to journal by default

- #

- # journalctl _SYSTEMD_UNIT=carbon-c-relay.service

- #

- #

- #Usage: relay [-vdst] -f <config> [-p <port>] [-w <workers>] [-b <size>] [-q <size>]

- #

- #Options:

- #  -v  print version and exit

+ # Pass extra options to the carbon-c-relay.

+ 

  #  -f  read <config> for clusters and routes

  #  -p  listen on <port> for connections, defaults to 2003

- #  -i  listen on <interface> for connections, defaults to all

  #  -l  write output to <file>, defaults to stdout/stderr

- #  -w  use <workers> worker threads, defaults to 4

+ #  -w  use <workers> worker threads, defaults to the amount of detected CPU cores

  #  -b  server send batch size, defaults to 2500

  #  -q  server queue size, defaults to 25000

- #  -S  statistics sending interval in seconds, defaults to 60

- #  -B  connection listen backlog, defaults to 3

+ #  -L  server max stalls, defaults to 4

+ #  -C  use CA <cert> to verify SSL connections

+ #  -B  connection listen backlog, defaults to 32

+ #  -U  socket receive buffer size, max/min/default values depend on OS

  #  -T  IO timeout in milliseconds for server connections, defaults to 600

- #  -m  send statistics like carbon-cache.py, e.g. not cumulative

+ #  -E  disable disconnecting idle connections after 10 minutes

  #  -c  characters to allow next to [A-Za-z0-9], defaults to -_:#

+ #  -m  max string length of metric, defaults to 0, limit of -M

+ #  -M  max string length of metric+ts+value+nl, defaults to 32768

  #  -d  debug mode: currently writes statistics to log, prints hash

  #      ring contents and matching position in test mode (-t)

  #  -s  submission mode: don't add any metrics to the stream like

  #      statistics, report drop counts and queue pressure to log

  #  -t  config test mode: prints rule matches from input on stdin

  #  -H  hostname: override hostname (used in statistics)

- #  -D  daemonise: run in a background

- #  -P  pidfile: write a pid to a specified pidfile

+ #  -O  minimum number of rules before optimising the ruleset, default: 50

  

- ARGS="-p 2003 -w 4 -b 2500 -q 25000"

+ #ARGS="-l /var/log/carbon-c-relay/carbon-c-relay.log"

@@ -1,26 +0,0 @@ 

- #Usage: relay [-vdst] -f <config> [-p <port>] [-w <workers>] [-b <size>] [-q <size>]

- #

- #Options:

- #  -v  print version and exit

- #  -f  read <config> for clusters and routes

- #  -p  listen on <port> for connections, defaults to 2003

- #  -i  listen on <interface> for connections, defaults to all

- #  -l  write output to <file>, defaults to stdout/stderr

- #  -w  use <workers> worker threads, defaults to 4

- #  -b  server send batch size, defaults to 2500

- #  -q  server queue size, defaults to 25000

- #  -S  statistics sending interval in seconds, defaults to 60

- #  -B  connection listen backlog, defaults to 3

- #  -T  IO timeout in milliseconds for server connections, defaults to 600

- #  -m  send statistics like carbon-cache.py, e.g. not cumulative

- #  -c  characters to allow next to [A-Za-z0-9], defaults to -_:#

- #  -d  debug mode: currently writes statistics to log, prints hash

- #      ring contents and matching position in test mode (-t)

- #  -s  submission mode: don't add any metrics to the stream like

- #      statistics, report drop counts and queue pressure to log

- #  -t  config test mode: prints rule matches from input on stdin

- #  -H  hostname: override hostname (used in statistics)

- #  -D  daemonise: run in a background

- #  -P  pidfile: write a pid to a specified pidfile

- 

- ARGS="-p 2003 -w 4 -b 2500 -q 25000 -l /var/log/carbon-c-relay/carbon-c-relay.log"

file modified
+1 -1

@@ -1,1 +1,1 @@ 

- SHA512 (carbon-c-relay-20dd600.tar.gz) = 90e548bd6a5e26e0cabefac9b64446c58d166293aeb4cb1437d67dfc04419e2f00f0ba045079d210667c3ceef5d8c41c1e2f30ec253b7c313446eceafff03a10

+ SHA512 (carbon-c-relay-3.6.tar.gz) = be7a77b1d7d98bd0e3879ebd8c37e6cbacd7132b707d2c0a52062df7a4214919b3fa430876ab0bb07a0fd7d83359ce888c7620fbc967cfe62177fe91c208b667

This drops EPEL support, but it is handled separately anyway (and stuck
on 3.3 release).

We don't need to set any default arguments in sysconfig file, it is
there just as a hint.

Also, there is no point in owning anything in /etc/systemd since those
are entirely are user-managed.

Signed-off-by: Igor Raits ignatenkobrain@fedoraproject.org

rebased onto 554286e

a month ago

rebased onto 7eff448

a month ago

I've had multiple complaints that a package update overwrites the service file and that people would keep losing their config. Apparently many people don't know they should configure in /etc/systemd, instead of having to explain it again in the future I added the text (which I copied/edited from some other popular Fedora package, can't remember which one). I'd like to keep that.

I've had multiple complaints that a package update overwrites the service file and that people would keep losing their config. Apparently many people don't know they should configure in /etc/systemd, instead of having to explain it again in the future I added the text (which I copied/edited from some other popular Fedora package, can't remember which one). I'd like to keep that.

They actually should use systemctl edit (which has --full option if needed). This is not really specific problem of carbon-c-relay package, but rather all daemons which have configuration. I think people should just study how to use systemd. That said, can you open discussion with Fedora Packaging Committee about that?

I prefer to add a small comment to the file people tend to edit. instead of letting them edit it, and then yell at them that they should "study how to use systemd". I don't get why you had to remove those comments, they don't do any harm.

Anyway, thanks for updating, am merging as is. I don't have much time to spend on Fedora lately, I appreciate it.

Pull-Request has been merged by piotrp

a month ago