public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/transmission] epel10: add systemd unit (#659919)
@ 2026-07-20 20:37 Praveen
  0 siblings, 0 replies; 2+ messages in thread
From: Praveen @ 2026-07-20 20:37 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/transmission
            Branch : epel10
            Commit : 3d899b1e7c873e0136f209d1b916623f92d2b020
            Author : Praveen <daredevil@localhost.localdomain>
            Date   : 2011-09-26T21:18:03+05:30
            Stats  : +13/-0 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/transmission/c/3d899b1e7c873e0136f209d1b916623f92d2b020?branch=epel10

            Log:
            add systemd unit (#659919)
drop sysconfig file

---
diff --git a/transmission-daemon-systemd b/transmission-daemon-systemd
new file mode 100644
index 0000000..c0ac6c2
--- /dev/null
+++ b/transmission-daemon-systemd
@@ -0,0 +1,13 @@
+# To customize, copy this file to /etc/systemd/system and edit there
+
+[Unit]
+Description=Transmission BT Client headless
+After=syslog.target network.target
+
+[Service]
+User=transmission
+ExecStart=/usr/bin/transmission-daemon -f -T --blocklist -g /var/lib/transmission/.config/transmission
+StandardError=syslog
+
+[Install]
+WantedBy=multi-user.target

^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [rpms/transmission] epel10: add systemd unit (#659919)
@ 2026-07-20 20:37 Praveen
  0 siblings, 0 replies; 2+ messages in thread
From: Praveen @ 2026-07-20 20:37 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/transmission
            Branch : epel10
            Commit : 45629872166fdde9486d8e81f640bc36c2830ca2
            Author : Praveen <daredevil@localhost.localdomain>
            Date   : 2011-09-24T17:22:31+05:30
            Stats  : +26/-128 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/transmission/c/45629872166fdde9486d8e81f640bc36c2830ca2?branch=epel10

            Log:
            add systemd unit (#659919)
drop sysconfig file

---
diff --git a/clog b/clog
index 13076e9..9fc3d8d 100644
--- a/clog
+++ b/clog
@@ -1 +1,2 @@
-Rebuilt for rpm (#728707)
+add systemd unit (#659919)
+drop sysconfig file

diff --git a/transmission-daemon-init b/transmission-daemon-init
index 5d0f8c2..e69de29 100755
--- a/transmission-daemon-init
+++ b/transmission-daemon-init
@@ -1,102 +0,0 @@
-#!/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-daemon
-
-# 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"
-
-
-# Config overrides
-
-if [ -f /etc/sysconfig/transmission-daemon ]; then
-        . /etc/sysconfig/transmission-daemon
-fi
-# 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
-    
-    daemon --check $DAEMON --user $DAEMON_USER $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
-
-

diff --git a/transmission-daemon-sysconfig b/transmission-daemon-sysconfig
index 62269c6..e69de29 100644
--- a/transmission-daemon-sysconfig
+++ b/transmission-daemon-sysconfig
@@ -1,5 +0,0 @@
-# example configuration file
-
-# TRANSMISSION_HOME=/home/foo
-# DAEMON_USER="foo"
-# DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission-daemon"

diff --git a/transmission.spec b/transmission.spec
index efdd899..5999ee1 100644
--- a/transmission.spec
+++ b/transmission.spec
@@ -1,6 +1,6 @@
 Name:           transmission
 Version:        2.33
-Release:        1%{?dist}.1
+Release:        2%{?dist}
 Summary:        A lightweight GTK+ BitTorrent client
 
 Group:          Applications/Internet
@@ -10,10 +10,8 @@ URL:            http://www.transmissionbt.com
 Source0:        http://download.transmissionbt.com/files/transmission-%{version}.tar.xz
 # This is intended to be merged by upstream post 1.80 release
 Source1:        transmission-qt.desktop
-# init script. Upstream doesn't want it because it is distro specific
-Source2:        transmission-daemon-init
-# Example conf file
-Source3:        transmission-daemon-sysconfig
+# systemd unit definition
+Source2:        transmission-daemon-systemd
 BuildRequires:  openssl-devel >= 0.9.4
 BuildRequires:  glib2-devel >= 2.15.5
 BuildRequires:  gtk2-devel >= 2.6.0
@@ -58,10 +56,10 @@ Summary:       Transmission daemon
 Group:         Applications/Internet
 Requires:      transmission-common
 Requires(pre): shadow-utils
-Requires(post): chkconfig
-Requires(preun): chkconfig
-Requires(preun): initscripts
-Requires(postun): initscripts
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+BuildRequires: systemd-units
 Provides:      transmission = %{version}-%{release}
 %description daemon
 Transmission BitTorrent client daemon.
@@ -112,11 +110,9 @@ popd
 
 
 %install
-mkdir -p %{buildroot}%{_initddir}
-mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
+mkdir -p %{buildroot}%{_unitdir}
 
-install -m755 %{SOURCE2} %{buildroot}%{_initddir}/transmission-daemon
-install -m644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/transmission-daemon
+install -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/transmission-daemon.service
 
 mkdir -p %{buildroot}/var/lib/transmission
 
@@ -134,7 +130,10 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ %{SOURCE1}
 touch --no-create %{_datadir}/icons/hicolor || :
 
 %post daemon
-/sbin/chkconfig --add transmission-daemon
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
 
 %post gtk
 update-desktop-database > /dev/null 2>&1 || :
@@ -144,8 +143,8 @@ update-desktop-database > /dev/null 2>&1 || :
 
 %preun daemon
 if [ $1 = 0 ] ; then
-    /sbin/service transmission-daemon stop >/dev/null 2>&1
-    /sbin/chkconfig --del transmission-daemon
+    /bin/systemctl stop transmission-daemon.service >/dev/null 2>&1 || :
+    /bin/systemctl disable transmission-daemon.service >/dev/null 2>&1 || :
 fi
 
 %postun common
@@ -155,8 +154,10 @@ touch --no-create %{_datadir}/icons/hicolor || :
 fi
 
 %postun daemon
-if [ "$1" -ge "1" ] ; then
-    /sbin/service transmission-daemon condrestart >/dev/null 2>&1 || :
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart transmission-daemon.service >/dev/null 2>&1 || :
 fi
 
 %postun gtk
@@ -191,8 +192,7 @@ update-desktop-database > /dev/null 2>&1 || :
 
 %files daemon
 %{_bindir}/transmission-daemon
-%{_initddir}/transmission-daemon
-%config(noreplace) %{_sysconfdir}/sysconfig/transmission-daemon
+%{_unitdir}/transmission-daemon.service
 %attr(-,transmission, transmission)/var/lib/transmission/
 %doc %{_mandir}/man1/transmission-daemon*
 
@@ -207,6 +207,10 @@ update-desktop-database > /dev/null 2>&1 || :
 %doc %{_mandir}/man1/transmission-qt.*
 
 %changelog
+* Sat Sep 10 2011 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.33-2
+- add systemd unit (#659919)
+- drop sysconfig file
+
 * Sun Aug 14 2011 Rex Dieter <rdieter@fedoraproject.org> - 2.33-1.1
 - Rebuilt for rpm (#728707)
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-20 20:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-20 20:37 [rpms/transmission] epel10: add systemd unit (#659919) Praveen
2026-07-20 20:37 Praveen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox