logd: create log directory for log_file
authorKarl Palsson <karlp@etactica.com>
Thu, 22 Feb 2018 11:09:53 +0000 (11:09 +0000)
committerHans Dedecker <dedeckeh@gmail.com>
Thu, 7 Jun 2018 15:19:42 +0000 (17:19 +0200)
If log_file is specified, make sure its directory exists.

Signed-off-by: Karl Palsson <karlp@etactica.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
package/system/ubox/Makefile
package/system/ubox/files/log.init

index 89cc6768fbeb24fc9c0a3ebc78ef97c74f28f027..85dddff858538354e9d1e571c7e4fab6d562d128 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ubox
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git
index 21e078712559f3e839c8154210bac766c3f231a0..ae5dd1f03dbf12256872ef4fbac1d8753e82b9fe 100644 (file)
@@ -55,6 +55,8 @@ start_service_file()
        }
        [ -z "${log_file}" ] && return
 
+       mkdir -p "$(dirname "${log_file}")"
+
        procd_open_instance
        procd_set_param command "$PROG" -f -F "$log_file" -p "$pid_file"
        [ -n "${log_size}" ] && procd_append_param command -S "$log_size"