pludov / mobindi

Control astronomy software from a mobile browser
GNU General Public License v3.0
25 stars 2 forks source link

auto startup mobindi #31

Closed dragonlost closed 4 years ago

dragonlost commented 4 years ago

Hello.

Everything works fine. I am on Raspberry Pi 4B 4gb of ram. Unfortunately it is impossible to operate the automatic start.

I try via a service or via the folder automatic start but impossible to start mobindi. All failed.

for autostartup folder :

echo -e '#!/bin/bash'"\ncd /home/$USER/bin/mobindi\n/home/$USER/bin/mobindi/startup.sh &\n" > /home/$USER/bin/mobindi_up.sh

chmod +x /home/$USER/bin/mobindi_up.sh echo -e "[Desktop Entry] Encoding=UTF-8 Version=1.1.0 Type=Application Name=UI_Indi Comment=Contrôle de Indi Exec=/home/$USER/bin/mobindi_up.sh StartupNotify=false Terminal=false Hidden=false" > /home/$USER/.config/autostart/mobindi.desktop chmod +x /home/$USER/.config/autostart/mobindi.desktop

for service :

dir=/etc/systemd/system #mettre le chemin du service en memoire MOI=${USER}

sudo updatedb # mettre à jour la base d'indexation

dir_mobindi="/home/$USER/bin/mobindi/startup.sh" #récupérer le chemin du binaire browsepy

echo -e '[UNIT]\nDescription=MobIndi\nAfter=multi-user.target\n\n[Service]\nType=idle\nUser='${MOI}'\nExecStart='${dir_mobindi}'\nRestart=Always\nRestartSec=5\n[Install]\nWantedBy=multi-user.target' >> /tmp/mobindi.service

sudo cp /tmp/mobindi.service ${dir}/ sudo rm /tmp/mobindi.service sudo chmod 644 ${dir}/mobindi.service

sudo systemctl daemon-reload sudo systemctl enable mobindi.service sudo systemctl start mobindi.service

pludov commented 4 years ago

You should have more info in /var/log/mobindi Does starting the service print something here ?

dragonlost commented 4 years ago

no have /var/log/mobindi

pludov commented 4 years ago

Does it run ok if you start /home/$USER/bin/mobindi/startup.sh from a terminal ?

dragonlost commented 4 years ago

would you be OK to discuss it on discord?

dragonlost commented 4 years ago

Once the pc started if I try to start the service by hand, it does not run.

On the other hand, if I run startup.sh and stop it, I can start the service without any problem. I can even stop and raise it as many times as I want.

dragonlost commented 4 years ago

after reboot i have exact same bug

dragonlost commented 4 years ago

after a lot of testing, just run at least once ./nginx/nginx.sh. Then the service runs correctly.

pludov commented 4 years ago

Hello,

Thank you for the report and the analysis. It is probably related to the initialization of the self-signed certificate required for ssl, maybe because of lake of entropy.

Do you think you can reproduce the problem ? If yes, please add the following "exec" line at the begining of nginx/install.sh to log the errors, then publish the content of /tmp/nginx-install.log here !

#!/bin/bash

set -euo pipefail

exec >> /tmp/nginx-install.log 2>&1 # Add this line

INSTALL_DIR="$(dirname "$BASH_SOURCE")"
dragonlost commented 4 years ago

need run install.sh ?

dragonlost commented 4 years ago

the log file is create but remains empty.

If you have an ubuntu to wear is easy enough to test. Just create a service that launches startup.sh

then activate and start it.

pludov commented 4 years ago

I tried to reproduce on ubuntu but found no problem.

However, make sure you run install.sh before first start. This will setup mobindi and its embedded nginx.

dragonlost commented 4 years ago

ok i clean my install proces. Nafabox is bug free for mobindi

dragonlost commented 2 years ago

Hello.

I switched to 20.04LTS for the nafabox, on the other hand I can no longer launch Mobindi at startup.

Each time you restart, the service that starts mobindi does not start. I have to start startup.sh by hand. Then CTRL + C. Then there the service wants this launch.

The service :

`[Unit] Description=MobIndi After=multi-user.target

[Service] Type=idle User=nafabox ExecStart=/home/nafabox/bin/mobindi/startup.sh Restart=Always RestartSec=5 [Install] WantedBy=multi-user.target`

Error message :

Started MobIndi. mobindi.service: Main process exited, code=exited, status=1/FAILURE mobindi.service: Failed with result 'exit-code' /etc/systemd/system/mobindi.service:9: Failed to parse service restart specifier, ignoring: Always