From 00c334af358907f491066f3a2def81da81b938b4 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Sun, 13 Nov 2011 22:15:43 +0000 Subject: [PATCH] packages/dmapd: use new service functions, create dmapd user & group and required directories SVN-Revision: 29058 --- net/dmapd/Makefile | 2 +- net/dmapd/files/dmapd.init | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/net/dmapd/Makefile b/net/dmapd/Makefile index 93881a97a..10eec49c3 100644 --- a/net/dmapd/Makefile +++ b/net/dmapd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dmapd PKG_VERSION:=0.0.43 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.flyn.org/projects/dmapd diff --git a/net/dmapd/files/dmapd.init b/net/dmapd/files/dmapd.init index b2f17c732..350db0018 100644 --- a/net/dmapd/files/dmapd.init +++ b/net/dmapd/files/dmapd.init @@ -1,16 +1,27 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2009-2010 OpenWrt.org +# Copyright (C) 2009-2011 OpenWrt.org START=60 start() { - mkdir -p /var/cache/dmapd/ - mkdir -p /var/run/dmapd/ - mkdir -p /var/lock/subsys/ + user_exists dmapd 56 || user_add dmapd 56 + group_exists dmapd 56 || group_add dmapd 56 + [ -d /var/run/dmapd ] || { + mkdir -m 0755 -p /var/run/dmapd + chown dmapd:dmapd /var/run/dmapd + } + [ -d /var/db/dmapd/DAAP ] || { + mkdir -m 0755 -p /var/db/dmapd/DAAP + chown dmapd:dmapd /var/db/dmapd/DAAP + } + mkdir -m 0755 -p /var/lock/subsys + mkdir -m 0755 -p /var/media/music + mkdir -m 0755 -p /var/media/pictures - DMAPD_DB_MODULE=bdb /usr/sbin/dmapd --vips-disc-threshold 64k + DMAPD_DB_MODULE=bdb \ + service_start /usr/sbin/dmapd -m /var/media/music -p /var/media/pictures --vips-disc-threshold 64k } stop() { - killall dmapd 2> /dev/null + service_stop /usr/sbin/dmapd } -- 2.30.2