Переглянути джерело

[Radicale] upstream to Radicale 1.1

* upstream to Radicale 1.1
* new "boot_delay" option (default 10 seconds) to wait for interfaces to come up before hotplug restarts are enabled.

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Christian Schoenebeck 9 роки тому
джерело
коміт
d2e9224965

+ 3
- 3
net/radicale/Makefile Переглянути файл

@@ -7,8 +7,8 @@
7 7
 include $(TOPDIR)/rules.mk
8 8
 
9 9
 PKG_NAME:=radicale
10
-PKG_VERSION:=0.10
11
-PKG_RELEASE:=2
10
+PKG_VERSION:=1.1
11
+PKG_RELEASE:=1
12 12
 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
13 13
 
14 14
 PKG_LICENSE:=GPL-3.0
@@ -16,7 +16,7 @@ PKG_LICENSE_FILES:=COPYING
16 16
 
17 17
 PKG_SOURCE:=Radicale-$(PKG_VERSION).tar.gz
18 18
 PKG_SOURCE_URL:=http://pypi.python.org/packages/source/R/Radicale/
19
-PKG_MD5SUM:=32655d8893962956ead0ad690cca6044
19
+PKG_MD5SUM:=2e3f11d05d7a21ee412dfd7bd5c38961
20 20
 
21 21
 # needed for "r"adicale <-> "R"adicale
22 22
 PKG_BUILD_DIR:=$(BUILD_DIR)/Radicale-$(PKG_VERSION)

+ 11
- 1
net/radicale/files/radicale.config Переглянути файл

@@ -10,6 +10,16 @@
10 10
 # Each Radicale's config [section] is setup as UCI config setting 'section'
11 11
 #
12 12
 
13
+####################################################
14
+# OpenWrt specific settings
15
+# not part of radicale package
16
+#
17
+config	system 'radicale'
18
+	# delayed startup at boot (default 10 seconds)
19
+	# to wait for netifd to bring up interfaces
20
+	# during this time iface hotplug events are ignored
21
+#	option	boot_delay	'10'
22
+
13 23
 ####################################################
14 24
 # Server options
15 25
 #
@@ -65,7 +75,7 @@ config	setting	'encoding'
65 75
 ####################################################
66 76
 # Authentication options
67 77
 #
68
-config setting 'auth'
78
+config	setting	'auth'
69 79
 
70 80
 	# Authentication method
71 81
 	# Value: None | htpasswd | IMAP | LDAP | PAM | courier | http | remote_user | custom

+ 2
- 0
net/radicale/files/radicale.hotplug Переглянути файл

@@ -2,6 +2,8 @@
2 2
 
3 3
 # only (re-)start on ifup
4 4
 [ "$ACTION" = "ifup" ] || exit 0
5
+# only start if boot_delay is done
6
+[ -f /tmp/radicale.hotplug ] || exit 0
5 7
 
6 8
 _PID=$(ps | grep '[p]ython.*[r]adicale' 2>/dev/null | awk '{print $1}')
7 9
 kill -1 $_PID 2>/dev/null

+ 17
- 1
net/radicale/files/radicale.init Переглянути файл

@@ -163,7 +163,22 @@ _set_permission() {
163 163
 }
164 164
 
165 165
 boot() {
166
-	return 0	# will be started by "iface" hotplug events
166
+	# wait a given time (default 10 seconds) before startup
167
+	# to wait for interfaces to come up / not using hotplug events during boot
168
+	_start() {
169
+		[ $1 -gt 0 ] && sleep $1
170
+		start
171
+	}
172
+
173
+	local _DELAY
174
+	_DELAY=$(uci_get "radicale" "system" "boot_delay" "10")
175
+	_start $_DELAY &
176
+	return 0
177
+}
178
+
179
+shutdown() {
180
+	rm -f /tmp/radicale.hotplug
181
+	stop
167 182
 }
168 183
 
169 184
 start() {
@@ -184,6 +199,7 @@ start() {
184 199
 	_set_permission
185 200
 
186 201
 	radicale --daemon --config=$SYSCFG
202
+	touch /tmp/radicale.hotplug
187 203
 
188 204
 	_running &	# check if running and syslog
189 205