Discuss Scratch

ajsya
Scratcher
1000+ posts

Help running Python Script in the background automatically.

So, I'm trying to host a python program on my Raspberry Pi 4 running Ubuntu server in the background without having to start it manually. I've tried a couple of possible solutions before landing on this guide that seemed to work well at first. The problem is that it keeps stopping after a few hours for no obvious reason. Here's the output that I've received:

● scratchmc.service - The Scratch Minecraft Server Directory
Loaded: loaded (/lib/systemd/system/scratchmc.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2022-04-27 06:35:33 UTC; 1 day 18h ago
Process: 5236 ExecStart=/home/ubuntu/Coding Files/Python Files/ScratchMCServerDirectory/env/bin/python /home/ubuntu/C>
Main PID: 5236 (code=exited, status=0/SUCCESS)

Apr 27 06:35:33 ubuntu python[5236]: ☁ playersample
Apr 27 06:35:33 ubuntu python[5236]: ☁ request
Apr 27 06:35:33 ubuntu python[5236]: Response sent!
Apr 27 06:35:33 ubuntu python[5236]: ☁ playersample
Apr 27 06:35:33 ubuntu systemd[1]: scratchmc.service: Succeeded.

If anyone could explain to me why this is happening and what I can do to fix it please let me know. All help is appreciated, thanks!

Feel free to message me on my profile if you need to tell me something/want someone to talk to.

Hi, I'm ajsya!

| GitHub | Wiki | My Posts |

Before creating a new topic on the forums search Ocular to see if one already exists!ˇ
Sid72020123
Scratcher
500+ posts

Help running Python Script in the background automatically.

You can use online IDEs like Replit and a pinging service to keep it alive 24/7

Last edited by Sid72020123 (April 29, 2022 14:45:50)


Sid72020123
Chiroyce
Scratcher
1000+ posts

Help running Python Script in the background automatically.

Sid72020123 wrote:

You can use online IDEs like Replit and a pinging service to keep it alive 24/7
They want to run it on their on device (Raspberry Pi) so that isn't a viable solution.







April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
Sid72020123
Scratcher
500+ posts

Help running Python Script in the background automatically.

Chiroyce wrote:

Sid72020123 wrote:

You can use online IDEs like Replit and a pinging service to keep it alive 24/7
They want to run it on their on device (Raspberry Pi) so that isn't a viable solution.
Ok. I thought that an online IDE would be better because you can keep your program running 24/7 instead of PC which needs to be shut down. They can also keep it always working but that would take much power and internet.

Sid72020123
Chiroyce
Scratcher
1000+ posts

Help running Python Script in the background automatically.

Sid72020123 wrote:

Ok. I thought that an online IDE would be better because you can keep your program running 24/7 instead of PC which needs to be shut down. They can also keep it always working but that would take much power and internet.
Yeah that's definitely true, lower costs and maintenance and less electricity being used. but what if they want it to interact with the local network or if they have some hardware devices equipped with the Raspberry Pi? Then a cloud service won't be helpful.







April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
ajsya
Scratcher
1000+ posts

Help running Python Script in the background automatically.

Sid72020123 wrote:

You can use online IDEs like Replit and a pinging service to keep it alive 24/7
I chose not to use replit because in my experience it has been very unreliable. Also, I am already having the raspberry pi run 24/7 because it has code-server installed on it so I can program while using my managed chromebook.

Feel free to message me on my profile if you need to tell me something/want someone to talk to.

Hi, I'm ajsya!

| GitHub | Wiki | My Posts |

Before creating a new topic on the forums search Ocular to see if one already exists!ˇ
ajsya
Scratcher
1000+ posts

Help running Python Script in the background automatically.

bump

Feel free to message me on my profile if you need to tell me something/want someone to talk to.

Hi, I'm ajsya!

| GitHub | Wiki | My Posts |

Before creating a new topic on the forums search Ocular to see if one already exists!ˇ

Powered by DjangoBB