aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Maxim Mikityanskiy <maxtram95@gmail.com>2015-07-20 00:18:01 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-27 23:54:41 +0200
commitc0f4bb97e4bc29b67bd1e17918cf3e694f137523 (patch)
tree6ec7072b0000b74968aa3a3634268b58d0c646b6
parentcac3cf8f9c36140eb0f5cd76665c1fdb0b47676c (diff)
downloadbuildroot-c0f4bb97e4bc29b67bd1e17918cf3e694f137523.tar.gz
buildroot-c0f4bb97e4bc29b67bd1e17918cf3e694f137523.tar.bz2
transmission: improve systemd support
Support running transmission-daemon in system-wide mode using systemd: 1. Pass --with-systemd-daemon to configure script if systemd is enabled. 2. Create the transmission user if having daemon 3. Install transmission-daemon.service for systemd. [Aurélien : Fix symlink relative path, use upstream service file, no need for config path, and use transmission user in sysv script, remove sysctl stuff] Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com> Signed-off-by: Aurélien Chabot <aurelien@chabot.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
-rw-r--r--package/transmission/S92transmission4
-rw-r--r--package/transmission/transmission.mk19
2 files changed, 20 insertions, 3 deletions
diff --git a/package/transmission/S92transmission b/package/transmission/S92transmission
index 18705228f1..e5976b0cfb 100644
--- a/package/transmission/S92transmission
+++ b/package/transmission/S92transmission
@@ -24,9 +24,7 @@
# by default, this is set to 'transmission'.
# For the sake of security you shouldn't set a password
# on this user
-#USERNAME=transmission
-USERNAME=default
-
+USERNAME=transmission
# ----- *ADVANCED* CONFIGURATION -----
diff --git a/package/transmission/transmission.mk b/package/transmission/transmission.mk
index bbc32bf118..efc00a1177 100644
--- a/package/transmission/transmission.mk
+++ b/package/transmission/transmission.mk
@@ -36,11 +36,30 @@ endif
ifeq ($(BR2_PACKAGE_TRANSMISSION_DAEMON),y)
TRANSMISSION_CONF_OPTS += --enable-daemon
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+TRANSMISSION_DEPENDENCIES += systemd
+TRANSMISSION_CONF_OPTS += --with-systemd-daemon
+else
+TRANSMISSION_CONF_OPTS += --without-systemd-daemon
+endif
+
+define TRANSMISSION_USERS
+ transmission -1 transmission -1 * /var/lib/transmission - transmission Transmission Daemon
+endef
+
define TRANSMISSION_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/transmission/S92transmission \
$(TARGET_DIR)/etc/init.d/S92transmission
endef
+define TRANSMISSION_INSTALL_INIT_SYSTEMD
+ $(INSTALL) -D -m 0755 $(@D)/daemon/transmission-daemon.service \
+ $(TARGET_DIR)/usr/lib/systemd/system/transmission-daemon.service
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+ ln -fs ../../../../usr/lib/systemd/system/transmission-daemon.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/transmission-daemon.service
+endef
+
else
TRANSMISSION_CONF_OPTS += --disable-daemon
endif