0

I'm trying to have my raspberry pi start a python server with connected Vue.js frontend at startup.

Right now i'm using crontab with the following configuration:

@reboot sh /home/pi/Desktop/server-client/server/launcher.sh >> /home/pi/Desktop/server-client/server/logs/log.txt 2>&1
@reboot sh /home/pi/Desktop/server-client/client/launcher.sh >> /home/pi/Desktop/server-client/client/logs/log.txt 2>&1

the launcher.shin the server folder is a simple python3 app.py while the launcher in the client folder is npm run dev

When i reboot the rpi only the server starts while the front end doesn't, i'm thinking that it may be because by running python3 the rpi stays stuck running the server and doesn't start the npm run dev process but i'm not sure (trying to avoid this is the reason i have 2 different @reboot instead of a single one and a unified launcher)

I have a flask server written in python with a vue.js frontend developed using npm. To start the server i use python3 app.py while t ostart the frontend i use npm run dev (this builds the frontend dependencies and serves it on a port). I wanted to start them both at startup so i set up a cron job, when i restart the rpi only the python3 command is executed but not the npm run dev one, i'm looking for a way to start them both automatically at startup (they work if i open 2 terminals and start them manually).

How can i make sure that both the python server and the Vue.js front end start when the rpi is rebooted?

  • What is a "python server"? Python is a programming language. And what client do you talk about? What does npm run dev mean? – Ingo Jun 20 at 18:21
  • @Ingo I have a flask server written in python with a vue.js frontend developed using npm. To start the server i use python3 app.py while t ostart the frontend i use npm run dev (this builds the frontend dependencies and serves it on a port). I wanted to start them both at startup so i set up a cron job, when i restart the rpi only the python3 command is executed but not the npm run dev one, i'm looking for a way to start them both automatically at startup (they work if i open 2 terminals and start them manually) – John Smith Jun 21 at 12:14
  • It is important information to understand your question that you missed to add. I have done it for you. – Ingo Jun 21 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.