public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Rahul Sundaram <sundaram@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/transmission] epel10: add a init script for Transmission daemon
Date: Mon, 20 Jul 2026 20:36:43 GMT	[thread overview]
Message-ID: <178457980318.1.1417063608543083960.rpms-transmission-6e560168e892@fedoraproject.org> (raw)

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
+
+

                 reply	other threads:[~2026-07-20 20:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178457980318.1.1417063608543083960.rpms-transmission-6e560168e892@fedoraproject.org \
    --to=sundaram@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox