CHOWN after rebbot from a py file


when I restart mycroft from a python file, I have a problem:

Starting all mycroft-core services
Changing ownership of /opt/mycroft to user: root with group: root

The ownership change and my device needs to be paired again…
My current user is normally PI

Someone has an idea?

I’m not a dev, but it sounds like you are using an OS restart, instead of a mycroft-msm(?) command line…

what device / OS … maybe a detail about the command you are using to ‘restart’???

Did you install as root?


thank you. I am novice in DEV.

I installed a Picroft stable image disk.
I am connected as “Pi”.

When I boot the system, all services start by “Pi” environnement.

i have a sh script which changes the language.
When I call this script from a python file this is where I run into this problem.

If I run my script from terminal it works fine.

I have created a folder /home/pi/Documents/Programs. Inside, my python file:

#!usr/bin/env python

import os
import subprocess

os.system(“chmod +x”)

here is the script:

#!/usr/bin/env bash

cd /home/pi/mycroft-core/bin/

bash ./mycroft-config set lang “en-us”
bash ./mycroft-config set “en-us”
bash ./mycroft-config set stt.mycroft.lang “en-us”

cd /home/pi/mycroft-core/

bash ./ restart all

I show you the PATH, all seems OK: