CHOWN after rebbot from a py file

Hi,

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

Starting all mycroft-core services
Initializing…
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?

Hi,

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.chdir("/home/pi/Documents/lightUs/Programs")
os.system(“chmod +x english.sh”)
os.system("./english.sh")


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 tts.google.lang “en-us”
bash ./mycroft-config set stt.mycroft.lang “en-us”

cd /home/pi/mycroft-core/

bash ./start-mycroft.sh restart all


I show you the PATH, all seems OK:


/home/pi/bin:/home/pi/mycroft-core/.venv/bin:/home/pi/bin:/home/pi/mycroft-core/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/username/mycroft-core/bin:/home/username/mycroft-core/bin:/home/pi/mycroft-core/bin:/home/pi/mycroft-core/bin


Olivier