From: kaliko Date: Fri, 21 Oct 2022 05:55:56 +0000 (+0200) Subject: Fixed startup X-Git-Tag: 0.18.2~4 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=eead40921859927953e73327840bd6ff090b77fe;p=mpd-sima.git Fixed startup MPD_sima not starting when var dir is not present. --- 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