stubby: fix init script
authorRosen Penev <rosenp@gmail.com>
Thu, 27 Feb 2020 03:47:59 +0000 (19:47 -0800)
committerRosen Penev <rosenp@gmail.com>
Mon, 9 Mar 2020 20:55:24 +0000 (13:55 -0700)
The configuration file was not being generated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit b95699c6475795ae4d500a43a7cd382de655ec3f)

net/stubby/Makefile
net/stubby/files/stubby.init

index ca3b16472e45290edf24abc26674945cbb5994b2..d8e59098eb0a5f0218269c20060c09346b1823de 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=stubby
 PKG_VERSION:=0.2.6
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/getdnsapi/$(PKG_NAME)
index 2f9d731028916541304352453f4157175eb6e0c9..ebc357bbdc21f2a63a8d8d93bb450580512695aa 100755 (executable)
@@ -20,7 +20,6 @@ boot()
 
 generate_config()
 {
-    local config_file="$1"
     local round_robin
     local tls_authentication
     local tls_query_padding_blocksize
@@ -205,7 +204,7 @@ generate_config()
     }
 
     config_foreach handle_resolver resolver
-} > "$config_file"
+} > "$config_file_tmp"
 
 start_service() {
     local config_file_tmp
@@ -223,10 +222,11 @@ start_service() {
         cp "$stubby_manual_config" "$stubby_config"
     else
         config_file_tmp="$stubby_config.$$"
-        generate_config "$config_file_tmp"
+        generate_config
         mv "$config_file_tmp" "$stubby_config"
     fi
-    chmod 0644 "$stubby_config"
+    chown stubby:stubby "$stubby_config"
+    chmod 0400 "$stubby_config"
 
     config_get command_line_arguments "global" command_line_arguments ""