From 40f38a501de7683cbac637ffd34dd91a9391b5ad Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Sat, 9 Jul 2022 21:30:53 -0400 Subject: [PATCH] ensure rundir exists with correct permissions --- docs/changes.txt | 2 ++ util/init.d/weewx-multi | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 7155dc45..c4ae0aa7 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -32,6 +32,8 @@ Refine translations for French skin. Thanks to user Pascal! Allow a custom cipher to be specified for FTP uploads. See option 'cipher' under [[FTP]]. +Ensure that rundir exists and has correct permissions in weewx-multi + 4.8.0 04/21/2022 Allow unit to be overridden for a specific plot by using new option 'unit'. diff --git a/util/init.d/weewx-multi b/util/init.d/weewx-multi index f52b47e1..4842b950 100755 --- a/util/init.d/weewx-multi +++ b/util/init.d/weewx-multi @@ -62,6 +62,12 @@ fi # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions +# ensure that the rundir exists and is writable by the user running weewx +if [ ! -d $WEEWX_RUNDIR ]; then + mkdir -p $WEEWX_RUNDIR + chown $WEEWX_USER $WEEWX_RUNDIR +fi + # start the daemon # 0 if daemon has been started # 1 if daemon was already running