public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/transmission] epel10: add a init script for Transmission daemon
@ 2026-07-20 20:36 Rahul Sundaram
0 siblings, 0 replies; only message in thread
From: Rahul Sundaram @ 2026-07-20 20:36 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/transmission
Branch : epel10
Commit : 6e560168e89226ae1e922ca63f565b4497938aee
Author : Rahul Sundaram <sundaram@fedoraproject.org>
Date : 2010-01-20T01:52:41+00:00
Stats : +96/-0 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/transmission/c/6e560168e89226ae1e922ca63f565b4497938aee?branch=epel10
Log:
add a init script for Transmission daemon
---
diff --git a/transmission-daemon-init b/transmission-daemon-init
new file mode 100755
index 0000000..9ca2283
--- /dev/null
+++ b/transmission-daemon-init
@@ -0,0 +1,96 @@
+#!/bin/bash
+#
+# This is a modified version of the original init script at
+# http://jasonfriedland.blogspot.com/2009/07/init-script-for-transmission-daemon-on.html
+# chkconfig: - 16 84
+# description: Start up transmission-daemon
+#
+# processname: transmission-daemon
+# config: /etc/sysconfig/transmission
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# Defaults
+TRANSMISSION_HOME=/var/lib/transmission
+
+DAEMON_USER="transmission"
+DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"
+
+# Daemon
+NAME=transmission-daemon
+
+DAEMON=$(which $NAME)
+DAEMON_PIDFILE=/var/run/$NAME.pid
+DAEMON_LOCKFILE=/var/lock/subsys/$NAME
+DAEMON_SCRIPTNAME=/etc/init.d/$NAME
+DAEMON_LOGFILE=/var/log/$NAME.log
+
+[ -x "$DAEMON" ] || exit 0
+
+start() {
+ echo -n $"Starting ${NAME}: "
+
+ if [ -n "$TRANSMISSION_HOME" ]; then
+ export TRANSMISSION_HOME
+ fi
+
+ su - $DAEMON_USER -c "$DAEMON $DAEMON_ARGS"
+
+ sleep 2
+
+ status $NAME &> /dev/null && echo_success || echo_failure
+ RETVAL=$?
+
+ if [ $RETVAL -eq 0 ]; then
+ touch $DAEMON_LOCKFILE
+ pidof -o %PPID -x $NAME > $DAEMON_PIDFILE
+ fi
+
+ echo
+}
+
+stop() {
+ echo -n $"Shutting down ${NAME}: "
+
+ killproc $NAME
+ RETVAL=$?
+
+ [ $RETVAL -eq 0 ] && /bin/rm -f $DAEMON_LOCKFILE $DAEMON_PIDFILE
+
+ echo
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ stop
+ start
+ ;;
+ condrestart|try-restart)
+ if [ -f $DAEMON_LOCKFILE ]; then
+ stop
+ start
+ fi
+ ;;
+ status)
+ status $NAME
+ ;;
+
+ *)
+ echo "Usage: $SCRIPTNAME {start|stop|restart|condrestart|status}" >&2
+ exit 3
+ ;;
+esac
+
+
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-20 20:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-20 20:36 [rpms/transmission] epel10: add a init script for Transmission daemon Rahul Sundaram
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox