From ae776b1091bfdea4e2764ccb2652471ee5c9ce00 Mon Sep 17 00:00:00 2001 From: xchaos Date: Sat, 2 Feb 2008 12:45:55 +0000 Subject: [PATCH] pre-release cleanup git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@65 251d49ef-1d17-4917-a970-b30cf55b089b --- CHANGELOG | 2 + INSTALL | 10 ++--- Makefile | 19 ++++++-- README | 17 ++++--- conf/prometheus.conf | 4 +- debian/conffiles | 3 ++ debian/copyright | 15 ++++--- debian/prometheus.patch | 24 ---------- debian/rules | 6 +-- .../{monthly-stats.c => prometheus-stats.c} | 0 prometheus.c | 45 ++++++++++--------- prometheus.debian | 2 +- sample-configuration/README | 6 +-- sample-configuration/hosts | 6 +-- sample-configuration/prometheus.conf | 38 ++++++++-------- 15 files changed, 100 insertions(+), 97 deletions(-) create mode 100644 debian/conffiles delete mode 100644 debian/prometheus.patch rename optional-tools/{monthly-stats.c => prometheus-stats.c} (100%) diff --git a/CHANGELOG b/CHANGELOG index e5e2b08..8943824 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,8 @@ version 0.7.8 2008-02-02 (xChaos) - added informational messages before running iptables-restore - fixed behaviour of "...-magic-relative-prio 0" + "...-fixed-fixed-prio 0" - "filter-type classify" prometheus.conf keyword tested in production enviroment +- log file /var/log/prometheus renamed to /var/log/prometheuslog +- credit file /var/run/prometheus.credit moved to /var/lib/misc version 0.7.7 2008-01-?? diff --git a/INSTALL b/INSTALL index 2c626ae..0d28cab 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ Prometheus QoS installation - canonical 1. run "./check-kernel-qos" script to check kernel modules HTB and SFQ (optional) -2. as a root, run "make install" (you shouldn't get errors...) +2. as a root, run "make install" (you shouldn't get errors, just some warnings) 3. edit /etc/prometheus/prometheus.conf (conf/prometheus.conf or sample-configuration/) 4. edit /etc/prometheus/hosts (conf/prometheus.hosts or sample-configuration/) 5. edit /etc/cron.d/prometheus to update preview, shutdown and reload times @@ -13,7 +13,7 @@ Prometheus QoS installation - canonical Prometheus QoS installation - alternative, old way 1. if can read read this, you have already unpacked the .tar.gz archive -2. run "make prometheus" (you shouldn't get errors...) +2. run "make prometheus" (you shouldn't get errors, just some warnings) 3. create /etc/prometheus/prometheus.conf (conf/prometheus.conf or sample-configuration/) 4. create /etc/prometheus/hosts (conf/prometheus.hosts or sample-configuration/) 5. to activate QoS manualy from command line, just run "./prometheus" @@ -36,7 +36,5 @@ echo -n 86400 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_establishe Prometheus Debian packages: -There are two ways to build Prometheus Debian package (*.deb) - -1. as a root access and debhelper package installed, run "make deb" -2. without root access or debhelper, run "./prometheus.debian-noroot-nodebhelper" +1. you need root access and "debhelper" package installed +2. run "make deb" or "sudo make deb" diff --git a/Makefile b/Makefile index a207410..45ac40f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PACKAGE=prometheus -VERSION=0.7.7 +VERSION=0.7.8 CFLAGS=-std=c99 -Wall prefix=/usr mandir=$(prefix)/share/man @@ -10,8 +10,20 @@ main: prometheus $(CC) -o prometheus prometheus.c deb: main - ./prometheus.debian - + arch=`dpkg-architecture -qDEB_HOST_ARCH` + maintainer="gandalf " + #patch -Nl deb/control + dpkg-buildpackage + +tgz: clean + cp -r . ../$(PACKAGE)-$(VERSION) + rm -rf ../$(PACKAGE)-$(VERSION)/.svn/ + rm -rf ../$(PACKAGE)-$(VERSION)/*/.svn/ + rm -rf ../$(PACKAGE)-$(VERSION)/*~ $(PACKAGE)-$(VERSION)/*/*~ + tar -czf $(PACKAGE)-$(VERSION).tar.gz ../$(PACKAGE)-$(VERSION) + rm -rf ../$(PACKAGE)-$(VERSION) + install: main install -d $(sbindir) install -d $(mandir)/man1 @@ -29,3 +41,4 @@ install: main clean: rm -f prometheus + rm -f optinal-tools/prometheus-stats diff --git a/README b/README index 39126ad..0fb1191 100644 --- a/README +++ b/README @@ -3,16 +3,19 @@ Prometheus QoS - steal fire from your ISP ! "fair-per-IP" quality of service utility requires Linux kernel with HTB qdisc enabled -GNU+ Copyright(G)2007, Michael Polak (xChaos) -Credits: Credits: CZFree.Net, Netdave, aquarius -...and Martin Devera (.cz) for his HTB qdisc (of course) -...and Jakub Walczak (.pl) for providing feedback and patches -...and Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port -...and Dial Telecom (slightly expensive ISP) for chance to test it + +Copyright(C) 2005-2008 Michael Polak (xChaos) original source code +Copyright(C) 2007-2008 Martin Svoboda (Ludva) iptables-restore, CLASSIFY + +Credit: CZFree.Net+Netdave (idea), Aquarius (.rpm), Gandalf (.deb) +...and: Martin Devera (.cz) for his HTB qdisc (of course) +...and: Jakub Walczak (.pl) for providing feedback and patches +...and: Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port +...and: Dial Telecom (our slightly expensive ISP) for chance to test it Feedback: xchaos(at)arachne.cz Homepage: http://gpl.arachne.cz - +SVN tree: https://dev.arachne.cz/svn/prometheus ============================================================================ QoS (or Quality-of-service) is IPv4 traffic shaper replacement for Internet diff --git a/conf/prometheus.conf b/conf/prometheus.conf index 2700201..ee6f17a 100644 --- a/conf/prometheus.conf +++ b/conf/prometheus.conf @@ -131,12 +131,12 @@ adsl-prometheus-htb-ceil-malus 0 #========================================================================== #Credit file settings - stores unused credit from previous runs #-------------------------------------------------------------------------- -credit-filename /var/run/prometheus.credit +credit-filename /var/lib/misc/prometheus.credit credit-enable 1 #1=yes|0=no #========================================================================== #Log file names and directories #-------------------------------------------------------------------------- -log-filename /var/log/prometheus +log-filename /var/log/prometheuslog log-traffic-directory /var/www/logs/ log-traffic-url-path logs/ #========================================================================== diff --git a/debian/conffiles b/debian/conffiles new file mode 100644 index 0000000..9627fc8 --- /dev/null +++ b/debian/conffiles @@ -0,0 +1,3 @@ +/etc/prometheus/prometheus.conf +/etc/prometheus/hosts +/etc/cron.d/prometheus diff --git a/debian/copyright b/debian/copyright index 887b6ca..9f70870 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,13 +3,14 @@ Sat, 5 Jan 2008 15:45:42 +0100. It was downloaded from https://dev.arachne.cz/svn/prometheus/downloads -Copyright: GNU+ Copyright(G)2007, Michael Polak (xChaos) -Credits: CZFree.Net, Netdave, aquarius - ...and Martin Devera (.cz) for his HTB qdisc (of course) - ...and Jakub Walczak (.pl) for providing feedback and patches - ...and Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port - ...and Dial Telecom (slightly expensive ISP) for chance to test it - +Copyright(C) 2005-2008 Michael Polak (xChaos) original source code +Copyright(C) 2007-2008 Martin Svoboda (Ludva) iptables-restore, CLASSIFY + +Credit: CZFree.Net+Netdave (idea), Aquarius (.rpm), Gandalf (.deb) +...and: Martin Devera (.cz) for his HTB qdisc (of course) +...and: Jakub Walczak (.pl) for providing feedback and patches +...and: Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port +...and: Dial Telecom (our slightly expensive ISP) for chance to test it License: diff --git a/debian/prometheus.patch b/debian/prometheus.patch deleted file mode 100644 index 2adf521..0000000 --- a/debian/prometheus.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- prometheus.c 2008-01-09 12:38:16.000000000 +0100 -+++ prometheus.c.deb 2008-01-09 15:51:48.098924554 +0100 -@@ -60,9 +60,9 @@ - char *config="/etc/prometheus/prometheus.conf"; /* main configuration file */ - char *hosts="/etc/prometheus/hosts"; /* line bandwidth definition file */ - char *tc="/sbin/tc"; /* requires tc with HTB support */ --char *iptables="/usr/sbin/iptables"; /* requires iptables utility */ --char *iptablessave="/usr/sbin/iptables-save"; /* new */ --char *iptablesrestore="/usr/sbin/iptables-restore"; /* new */ -+char *iptables="/sbin/iptables"; /* requires iptables utility */ -+char *iptablessave="/sbin/iptables-save"; /* new */ -+char *iptablesrestore="/sbin/iptables-restore"; /* new */ - char *iptablesfile="/var/spool/prometheus.iptables"; /* new; file for iptables-restore*/ - char *iptablespreamble="*mangle\n:PREROUTING ACCEPT [0:0]\n:POSTROUTING ACCEPT [0:0]\n:INPUT ACCEPT [0:0]\n:OUTPUT ACCEPT [0:0]\n:FORWARD ACCEPT [0:0]"; - FILE *iptables_file=NULL; -@@ -72,7 +72,7 @@ - char *credit="/var/run/prometheus.credit"; /* credit log file */ - int enable_credit=1; /* enable credit file */ - int use_credit=0; /* use credit file (if enabled)*/ --char *log_dir="/var/www/html/logs/"; /* log directory pathname */ -+char *log_dir="/var/www/logs/"; /* log directory pathname */ - char *log_url="logs/"; /* log directory URL prefix */ - char *title="Hall of Fame - Greatest Suckers"; /* hall of fame title */ - int hall_of_fame=1; /* enable hall of fame */ diff --git a/debian/rules b/debian/rules index 7b5d313..78ad66a 100755 --- a/debian/rules +++ b/debian/rules @@ -6,7 +6,7 @@ CFLAGS = -Wall -g bindir = /usr/sbin mandir = /usr/share/man sysconfdir = /etc -destdir = $(CURDIR)/debian/prometheus +destdir = $(CURDIR)/deb/prometheus docdir = /usr/share/doc ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) @@ -20,7 +20,7 @@ build: build-stamp build-stamp: dh_testdir $(CC) -o $(CURDIR)/prometheus $(CURDIR)/prometheus.c -# $(CC) -o $(CURDIR)/prometheus-monthly-stats $(CURDIR)/optional-tools/monthly-stats.c +# $(CC) -o $(CURDIR)/prometheus-stats $(CURDIR)/optional-tools/prometheus-stats.c touch $@ @@ -40,7 +40,7 @@ install: build dh_clean -k dh_installdirs install -m 755 -o root -g root $(CURDIR)/prometheus $(destdir)$(bindir) -# install -m 755 -o root -g root $(CURDIR)prometheus-monthly-stats $(destdir)$(bindir) +# install -m 755 -o root -g root $(CURDIR)/prometheus-stats $(destdir)$(bindir) install -m 644 -o root -g root $(CURDIR)/prometheus.1 $(destdir)$(mandir)/man1 install -m 644 -o root -g root $(CURDIR)/prometheus.conf.5 $(destdir)$(mandir)/man5 install -m 755 -o root -g root $(CURDIR)/conf/prometheus.init $(destdir)$(sysconfdir)/init.d/prometheus diff --git a/optional-tools/monthly-stats.c b/optional-tools/prometheus-stats.c similarity index 100% rename from optional-tools/monthly-stats.c rename to optional-tools/prometheus-stats.c diff --git a/prometheus.c b/prometheus.c index c7887a0..fcba898 100644 --- a/prometheus.c +++ b/prometheus.c @@ -7,7 +7,7 @@ /* == Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf == */ /* =============================================================== */ -/* Modified: xChaos, 20080201 +/* Modified: xChaos, 20080202 ludva, 20071227 Prometheus QoS is free software; you can redistribute it and/or @@ -35,6 +35,24 @@ const char *version="0.7.8"; /*0.7.9 will be last development, 0.8.0 first stable */ +/* ======= All path names are defined hear (for RPM patch) ======= */ + +char *tc = "/sbin/tc"; /* requires tc with HTB support */ +char *iptables = "/sbin/iptables"; /* requires iptables utility */ +char *iptablessave = "/sbin/iptables-save"; /* not yet required */ +char *iptablesrestore = "/sbin/iptables-restore"; /* requires iptables-restore */ + +char *config = "/etc/prometheus/prometheus.conf"; /* main configuration file */ +char *hosts = "/etc/prometheus/hosts"; /* per-IP bandwidth definition file */ + +char *iptablesfile = "/var/spool/prometheus.iptables"; /* temporary file for iptables-restore*/ +char *credit = "/var/lib/misc/prometheus.credit"; /* credit log file */ +char *html = "/var/www/traffic.html"; /* hall of fame filename */ +char *preview = "/var/www/preview.html"; /* hall of fame preview */ +char *cmdlog = "/var/log/prometheuslog"; /* command log filename */ +char *log_dir = "/var/www/logs/"; /* log directory pathname, ended with slash */ +char *log_url = "logs/"; /* log directory relative URI prefix (partial URL) */ + /* ======= Help screen is hopefuly self-documenting part of code :-) ======= */ void help(void) @@ -59,23 +77,10 @@ int filter_type=1; /*1 mark, 2 classify*/ char *mark="MARK"; char *mark_iptables="MARK --set-mark "; int dry_run=0; /* preview - use puts() instead of system() */ -char *config="/etc/prometheus/prometheus.conf"; /* main configuration file */ -char *hosts="/etc/prometheus/hosts"; /* line bandwidth definition file */ -char *tc="/sbin/tc"; /* requires tc with HTB support */ -char *iptables="/sbin/iptables"; /* requires iptables utility */ -char *iptablessave="/sbin/iptables-save"; /* new */ -char *iptablesrestore="/sbin/iptables-restore"; /* new */ -char *iptablesfile="/var/spool/prometheus.iptables"; /* new; file for iptables-restore*/ char *iptablespreamble="*mangle\n:PREROUTING ACCEPT [0:0]\n:POSTROUTING ACCEPT [0:0]\n:INPUT ACCEPT [0:0]\n:OUTPUT ACCEPT [0:0]\n:FORWARD ACCEPT [0:0]"; FILE *iptables_file=NULL; -char *html="/var/www/traffic.html"; /* hall of fame filename */ -char *preview="/var/www/preview.html"; /* hall of fame preview */ -char *cmdlog="/var/log/prometheus"; /* command log filename */ -char *credit="/var/run/prometheus.credit"; /* credit log file */ int enable_credit=1; /* enable credit file */ int use_credit=0; /* use credit file (if enabled)*/ -char *log_dir="/var/www/logs/"; /* log directory pathname */ -char *log_url="logs/"; /* log directory URL prefix */ char *title="Hall of Fame - Greatest Suckers"; /* hall of fame title */ int hall_of_fame=1; /* enable hall of fame */ char *lan="eth0"; /* LAN interface */ @@ -570,17 +575,17 @@ void run_restore(void) save_line("COMMIT"); fclose(iptables_file); - if(dry_run) { + if(dry_run) + { parse(iptablesfile) { str=_; printf("%s\n", str); }done; - }else{ - //sprintf(restor,"cat %s",iptablesfile); else - sprintf(restor,"%s <%s",iptablesrestore, iptablesfile); - system(restor); - }; + } + + sprintf(restor,"%s <%s",iptablesrestore, iptablesfile); + safe_run(restor); free(restor); } diff --git a/prometheus.debian b/prometheus.debian index 1f5308b..d5487e5 100755 --- a/prometheus.debian +++ b/prometheus.debian @@ -5,7 +5,7 @@ version=`grep VERSION Makefile | gawk -F= '{ print $2 }'` package=`grep PACKAGE Makefile | gawk -F= '{ print $2 }'` maintainer='gandalf ' -patch -Nl MB/day -wifi-normal-magic-relative-prio 6 #*kb/sec->MB/day +wifi-normal-magic-relative-prio 4 #*kb/sec->MB/day wifi-normal-magic-fixed-limit 0 #MB, less then wifi-normal-magic-fixed-prio 0 #MB, less then -wifi-plus-magic-relative-limit 12 +wifi-plus-magic-relative-limit 16 wifi-plus-magic-relative-prio 8 wifi-plus-magic-fixed-limit 0 wifi-plus-magic-fixed-prio 0 -backbone-normal-magic-relative-limit 12 +backbone-normal-magic-relative-limit 16 backbone-normal-magic-relative-prio 8 backbone-normal-magic-fixed-limit 0 backbone-normal-magic-fixed-prio 0 -backbone-plus-magic-relative-limit 16 -backbone-plus-magic-relative-prio 12 +backbone-plus-magic-relative-limit 32 +backbone-plus-magic-relative-prio 16 backbone-plus-magic-fixed-limit 0 backbone-plus-magic-fixed-prio 0 backbone-bezfup-magic-relative-limit 0 @@ -142,12 +144,12 @@ backbone-bezfup-htb-ceil-malus 0 #========================================================================== #Credit file settings - stores unused credit from previous runs #-------------------------------------------------------------------------- -credit-filename /var/run/prometheus.credit +credit-filename /var/lib/misc/prometheus.credit credit-enable 1 #1=yes|0=no #========================================================================== #Log file names and directories #-------------------------------------------------------------------------- -log-filename /var/log/prometheus +log-filename /var/log/prometheuslog log-traffic-directory /var/www/logs/ log-traffic-url-path logs/ #========================================================================== -- 2.30.2