From eead40921859927953e73327840bd6ff090b77fe Mon Sep 17 00:00:00 2001 From: kaliko Date: Fri, 21 Oct 2022 07:55:56 +0200 Subject: [PATCH] Fixed startup MPD_sima not starting when var dir is not present. --- .gitlab-ci.yml | 5 +++++ sima/utils/config.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8379c87..195423e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,12 +32,17 @@ smoketest: - pip install dist/*.whl # smoke test - mpd-sima --help + - TRACE=y ./mpd-sima -d --pid ./mpd-sima.pid -l ./mpd-sima.log + - sleep 10 + - test -f ./mpd-sima.pid && kill $(cat ./mpd-sima.pid) artifacts: expire_in: 1 hour paths: - dist/*.whl - dist/*.tar.gz - dist/*.zip + - ./mpd-sima.pid + - ./mpd-sima.log unittests: stage: test diff --git a/sima/utils/config.py b/sima/utils/config.py index caaac3e..1df4e9e 100644 --- a/sima/utils/config.py +++ b/sima/utils/config.py @@ -143,9 +143,6 @@ class ConfMan: # CONFIG MANAGER CLASS self.supersedes_config_with_cmd_line_options() # set dbfile self.config['sima']['db_file'] = join(self.config['sima']['var_dir'], 'sima.db') - # Controls files access - self.control_facc() - # Create directories data_dir = self.config['sima']['var_dir'] if not isdir(data_dir): @@ -153,6 +150,9 @@ class ConfMan: # CONFIG MANAGER CLASS makedirs(data_dir) chmod(data_dir, 0o700) + # Controls files access + self.control_facc() + def control_facc(self): """Controls file access. This is relevant only for file provided through the configuration file -- 2.39.5