From b07b9ac11b736259c3cbca6f345f15980d48341f Mon Sep 17 00:00:00 2001 From: xchaos Date: Thu, 10 Jan 2008 10:19:47 +0000 Subject: [PATCH] debian-noroot-nodebhelper fix git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@53 251d49ef-1d17-4917-a970-b30cf55b089b --- INSTALL | 51 ++++++---- .../prometheus.conffiles | 0 .../prometheus.control | 0 prometheus-debian.old | 94 ------------------- prometheus.c | 8 +- 5 files changed, 38 insertions(+), 115 deletions(-) rename prometheus.conffiles => debian-noroot-nodebhelper/prometheus.conffiles (100%) rename prometheus.control => debian-noroot-nodebhelper/prometheus.control (100%) delete mode 100755 prometheus-debian.old diff --git a/INSTALL b/INSTALL index 302cafd..2c626ae 100644 --- a/INSTALL +++ b/INSTALL @@ -1,25 +1,42 @@ -Prometheus QoS Installation Guide: +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...) +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 +6. run "/etc/init.d/prometheus start" to activate QoS +7. run "/etc/init.d/prometheus stop" to shutdown QoS and generate stats +8. run "/etc/init.d/prometheus kill" to force immediate flush of QoS rules +9. setup /etc/init.d/prometheus to your system init (distribution dependent) + +Prometheus QoS installation - alternative, old way 1. if can read read this, you have already unpacked the .tar.gz archive -2. type "make prometheus" +enter (you shouldn't get errors...) -3. create /etc/prometheus.conf (see prometheus.conf.SAMPLE or sample-configuration/*) -4. create /etc/hosts (or /etc/qos.conf, see hosts.SAMPLE or sample-configuration/*) -5. to activate QoS manualy from command line, just type ./prometheus -6. to softly shutdown QoS (and generate stats), type ./prometheus -f ("flush") -7. to force immediate flush of QoS rules, type ./prometheus -9 ("kill") - -Promethetus QoS Advanced tips: - -1. I prefere to launch prometheus using "screen" utitlity (not tested without it) -2. use -p command line switch to generate instant and safe Hall of fame preview -3. use qos-free-delay option for pause after flushing old rules/before loading new -4. use magic-relative-limit option to fine tune your Fair Use Policy (daily quotas) -5. note: qos-proxy-enable and qos-free-zone won't work together -6. you can setup /etc/crontab using /sample-configuration/crontab.SAMPLE -7. warning: doing SNAT and QoS on the same router may cause performance problems +2. run "make prometheus" (you shouldn't get errors...) +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" +6. to softly shutdown QoS (and generate stats), run "./prometheus -f" ("flush") +7. to force immediate flush of QoS rules, run "./prometheus -9" ("kill") + +Promethetus QoS advanced tips: + +1. use -p command line switch to generate instant and safe Hall of fame preview +2. use qos-free-delay option for pause after flushing old rules/before loading new +3. take time to understand sample-configuration/ files prometheus.conf and hosts +4. note: qos-proxy-enable and qos-free-zone won't work together +5. warning: doing SNAT and QoS on the same router may cause performance problems General Linux routing tips for beginners: echo -n 1 > /proc/sys/net/ipv4/ip_forward echo -n 64000 > /proc/sys/net/ipv4/ip_conntrack_max echo -n 86400 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established + +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" diff --git a/prometheus.conffiles b/debian-noroot-nodebhelper/prometheus.conffiles similarity index 100% rename from prometheus.conffiles rename to debian-noroot-nodebhelper/prometheus.conffiles diff --git a/prometheus.control b/debian-noroot-nodebhelper/prometheus.control similarity index 100% rename from prometheus.control rename to debian-noroot-nodebhelper/prometheus.control diff --git a/prometheus-debian.old b/prometheus-debian.old deleted file mode 100755 index 99cd5ef..0000000 --- a/prometheus-debian.old +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash - -MAINTAINER='Michael Polak ' -DEB_PCK_NAME=prometheus -ARCHITECTURE=i386 -DEBIAN_BASE=$DEB_PCK_NAME.tmp - -# Adresare -rm -r $DEBIAN_BASE 2>/dev/null -mkdir -p $DEBIAN_BASE -mkdir -p $DEBIAN_BASE/usr -mkdir -p $DEBIAN_BASE/usr/sbin -mkdir -p $DEBIAN_BASE/usr/share -mkdir -p $DEBIAN_BASE/usr/share/man -mkdir -p $DEBIAN_BASE/usr/share/man/man1 -mkdir -p $DEBIAN_BASE/usr/share/man/man5 - -mkdir -p $DEBIAN_BASE/DEBIAN -chmod 0755 $DEBIAN_BASE/DEBIAN - -if ! [ -x prometheus ]; then - make main -fi - -# Copy -cp prometheus $DEBIAN_BASE/usr/sbin -cp prometheus.1 $DEBIAN_BASE/usr/share/man/man1 -cp prometheus.conf.5 $DEBIAN_BASE/usr/share/man/man5 -cp -R etc $DEBIAN_BASE/etc - -# .svn cleanup -rm -rf $DEBIAN_BASE/etc/.svn -rm -rf $DEBIAN_BASE/etc/*/.svn - -# Chmod a+x scripts -chmod 755 $DEBIAN_BASE/etc/cron.d/prometheus -chmod 755 $DEBIAN_BASE/etc/init.d/prometheus - -# Strip debug info from binary -strip $DEBIAN_BASE/usr/sbin/prometheus - -# Zmeni uzivatele a skupinu -chown -R root:root $DEBIAN_BASE - -# MD5 start -find $DEBIAN_BASE -type f -exec md5sum {} \; >> $DEBIAN_BASE/DEBIAN/_md5sum -# odstraneni $DEBIAN_BASE z adresare -sed -r "s:$DEBIAN_BASE::g" $DEBIAN_BASE/DEBIAN/_md5sum > $DEBIAN_BASE/DEBIAN/md5sum; -rm $DEBIAN_BASE/DEBIAN/_md5sum -# MD5 - end - -# Control file -cp -R $DEB_PCK_NAME.control $DEBIAN_BASE/DEBIAN/control -if [ -f $DEB_PCK_NAME'.postinst' ]; then - cp -R $DEB_PCK_NAME.postinst $DEBIAN_BASE/DEBIAN/postinst -fi -if [ -f $DEB_PCK_NAME'.preinst' ]; then - cp -R $DEB_PCK_NAME.preinst $DEBIAN_BASE/DEBIAN/preinst -fi -if [ -f $DEB_PCK_NAME'.conffiles' ]; then - cp -R $DEB_PCK_NAME.conffiles $DEBIAN_BASE/DEBIAN/conffiles -fi -if [ -f $DEB_PCK_NAME'.prerm' ]; then - cp -R $DEB_PCK_NAME.prerm $DEBIAN_BASE/DEBIAN/prerm -fi -if [ -f $DEB_PCK_NAME'.postrm' ]; then - cp -R $DEB_PCK_NAME.postrm $DEBIAN_BASE/DEBIAN/postrm -fi - -# Cleanup -for f in `find $DEBIAN_BASE/etc -path ".svn*"` -do - rm -R $f 2>/dev/null -done; - -# Momentalne se nepouziva -#SIZEDU=`du -sk "$DEBIAN_BASE" | awk '{ print $1}'` -#SIZEDIR=`find "$DEBIAN_BASE" -type d | wc | awk '{print $1}'` -#SIZE=$[ $SIZEDU - $SIZEDIR ] - -# Verze -VERSION=`grep "const char \*version" prometheus.c|cut -f 2 -d \"` - -# Control file -sed -e "s/__VERSION__/$VERSION/" \ - -e "s/__PACKAGE__/$DEB_PCK_NAME/" \ - -e "s/__MAINTAINER__/$MAINTAINER/" \ - -e "s/__ARCHITECTURE__/$ARCHITECTURE/" \ - $DEB_PCK_NAME.control > $DEBIAN_BASE/DEBIAN/control - -# Vytvori a prejmenuje balicek -dpkg --build $DEBIAN_BASE -dpkg-name -o $DEBIAN_BASE.deb -rm -rf $DEBIAN_BASE diff --git a/prometheus.c b/prometheus.c index 979516e..5a9f009 100644 --- a/prometheus.c +++ b/prometheus.c @@ -60,9 +60,9 @@ 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="/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 *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/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 */ -- 2.30.2