head 1.7; access; symbols OPENPKG_E1_MP_HEAD:1.6 OPENPKG_E1_MP:1.6 OPENPKG_E1_MP_2_STABLE:1.4.8.1 OPENPKG_E1_FP:1.4.8.1 OPENPKG_2_STABLE_MP:1.5 OPENPKG_2_STABLE_20061018:1.4.8.1 OPENPKG_2_STABLE_20060622:1.4 OPENPKG_2_STABLE:1.4.0.8 OPENPKG_2_STABLE_BP:1.4 OPENPKG_2_5_RELEASE:1.4 OPENPKG_2_5_SOLID:1.4.0.6 OPENPKG_2_5_SOLID_BP:1.4 OPENPKG_2_4_RELEASE:1.4 OPENPKG_2_4_SOLID:1.4.0.4 OPENPKG_2_4_SOLID_BP:1.4 OPENPKG_CW_FP:1.4 OPENPKG_2_3_RELEASE:1.4 OPENPKG_2_3_SOLID:1.4.0.2 OPENPKG_2_3_SOLID_BP:1.4 OPENPKG_2_2_RELEASE:1.3 OPENPKG_2_2_SOLID:1.3.0.2 OPENPKG_2_2_SOLID_BP:1.3 OPENPKG_2_1_RELEASE:1.2 OPENPKG_2_1_SOLID:1.2.0.2 OPENPKG_2_1_SOLID_BP:1.2; locks; strict; comment @# @; 1.7 date 2007.01.19.09.03.43; author cs; state Exp; branches; next 1.6; commitid xHzq8JN9JhRA263s; 1.6 date 2006.11.03.19.42.39; author rse; state Exp; branches; next 1.5; commitid jfYs1DOvD6Ff3gTr; 1.5 date 2006.08.25.19.16.01; author rse; state Exp; branches; next 1.4; commitid Tvsj1UyQ8rQ89gKr; 1.4 date 2004.12.07.19.57.27; author rse; state Exp; branches 1.4.8.1; next 1.3; 1.3 date 2004.07.06.11.18.05; author ms; state Exp; branches; next 1.2; 1.2 date 2004.05.19.07.24.04; author rse; state Exp; branches; next 1.1; 1.1 date 2004.05.18.20.12.21; author rse; state Exp; branches; next ; 1.4.8.1 date 2006.10.16.14.48.33; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; desc @@ 1.7 log @added missing %restart target used in %post of the spec @ text @#!@@l_prefix@@/bin/openpkg rc ## ## rc.bittorrent -- Run-Commands ## %config bittorrent_enable="$openpkg_rc_def" bittorrent_port="6969" bittorrent_bind="127.0.0.1" bittorrent_flags="" bittorrent_log_prolog="true" bittorrent_log_epilog="true" bittorrent_log_numfiles="10" bittorrent_log_minsize="1M" bittorrent_log_complevel="9" %common bittorrent_datadir="@@l_prefix@@/var/bittorrent" bittorrent_datafile="@@l_prefix@@/var/bittorrent/bittorrent-tracker.data" bittorrent_logfile="@@l_prefix@@/var/bittorrent/bittorrent-tracker.log" bittorrent_pidfile="@@l_prefix@@/var/bittorrent/bittorrent-tracker.pid" bittorrent_signal () { [ -f $bittorrent_pidfile ] \ && kill -$1 `cat $bittorrent_pidfile` } %status -u @@l_rusr@@ -o bittorrent_usable="no" bittorrent_active="no" rcService bittorrent enable yes && \ bittorrent_signal 0 && bittorrent_active="yes" echo "bittorrent_enable=\"$bittorrent_enable\"" echo "bittorrent_usable=\"$bittorrent_usable\"" echo "bittorrent_active=\"$bittorrent_active\"" %start -u @@l_rusr@@ rcService bittorrent enable yes || exit 0 rcService bittorrent active yes && exit 0 export HOME="$bittorrent_datadir" ( nohup @@l_prefix@@/bin/bittorrent-tracker \ --port "$bittorrent_port" \ --bind "$bittorrent_bind" \ --dfile "$bittorrent_datafile" \ --data_dir "$bittorrent_datadir" \ --logfile "$bittorrent_logfile" \ --pid "$bittorrent_pidfile" \ --twisted 1 bittorrent_flags \ /dev/null 2>&1 & ) >/dev/null 2>&1 %stop -u @@l_rusr@@ rcService bittorrent enable yes || exit 0 rcService bittorrent active no && exit 0 bittorrent_signal TERM sleep 2 rm -f $bittorrent_pidfile 2>/dev/null || true %restart -u @@l_rusr@@ rcService bittorrent enable yes || exit 0 rcService bittorrent active no && exit 0 rc bittorrent stop start %daily -u @@l_susr@@ rcService bittorrent enable yes || exit 0 shtool rotate -f \ -n ${bittorrent_log_numfiles} -s ${bittorrent_log_minsize} -d \ -z ${bittorrent_log_complevel} -m 644 -o @@l_rusr@@ -g @@l_rgrp@@ \ -P "${bittorrent_log_prolog}" \ -E "${bittorrent_log_epilog}; rc bittorrent restart" \ $bittorrent_logfile @ 1.6 log @upgrading package: bittorrent 4.26.0 -> 5.0.0 @ text @d58 5 @ 1.5 log @replace '@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc' in shebang with '@@l_prefix@@/bin/openpkg rc' to allow people who run the rc.xxx scripts directly (as executables) to leverage from the Set-UID functionality @ text @d9 2 d18 4 a21 3 bittorrent_datafile="@@l_prefix@@/var/bittorrent/bttrack.data" bittorrent_logfile="@@l_prefix@@/var/bittorrent/bttrack.log" bittorrent_pidfile="@@l_prefix@@/var/bittorrent/bttrack.pid" d27 1 a27 1 %status -u @@l_susr@@ -o d30 2 d39 10 a48 6 ( nohup @@l_prefix@@/bin/bttrack \ --port $bittorrent_port \ --dfile $bittorrent_datafile \ --logfile $bittorrent_logfile \ /dev/null 2>&1 & echo $! >$bittorrent_pidfile @ 1.4 log @remove priorities (actually inherited via cut & paste from rc.bind ;-) from packages where the default priority is fully sufficient; fix %stop priorities: they have to be 1000 minus the %start priority in order to stop a package later if it was started earlier. @ text @d1 1 a1 1 #!@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc @ 1.4.8.1 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d1 1 a1 1 #!@@l_prefix@@/bin/openpkg rc @ 1.3 log @in rc.*:%daily, restart daemons per default in shtool epilog should a logfile rotation be performed @ text @d31 1 a31 1 %start -p 100 -u @@l_rusr@@ d42 1 a42 1 %stop -p 100 -u @@l_rusr@@ @ 1.2 log @add Apache config snippet and use --logfile on the tracker @ text @d55 1 a55 1 -E "${bittorrent_log_epilog} && rc bittorrent restart" \ @ 1.1 log @new package: bittorrent 3.4.2 (BitTorrent Peer-To-Peer Networking) @ text @d37 2 a38 2 >>$bittorrent_logfile \ /dev/null & @