Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add services for Flask server and GUI #63

Merged
merged 6 commits into from Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions install/Service-README.md
@@ -0,0 +1,21 @@
# Services

In this install folder there are two service files.

To set up these services, first move them into the `/etc/systemd/system/` directory.

From there, you can use the following commands to manage the services:

`systemctl start <service-name>`
*Start the service*

`systemctl enable <service-name>`
*Enables the service so it will start after future reboots*

`systemctl status <service-name>`
*Displays basic information about the status of the service (i.e. whether it is running or not)*

`journalctl -u <service-name>`
*Displays service stdout logs, useful for if a service crashes and you need to debug*


12 changes: 12 additions & 0 deletions install/block-editor.service
@@ -0,0 +1,12 @@
[Unit]
Description=Block Code Editor Web Server
After=network.target

[Service]
User=admin
WorkingDirectory=/home/admin/project-blastpad/flask
ExecStart=flask --app serve run
Restart=always

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions install/launcher-gui.service
@@ -0,0 +1,15 @@
[Unit]
Description=Launcher GUI
After=graphical.target
Wants=graphical.target

[Service]
Type=simple
User=admin
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/admin/.Xauthority"
ExecStart=/bin/bash -c "export DISPLAY=:0; /usr/bin/python3 /home/admin/project-blastpad/home/homeScreenGui.py"
Restart=always

[Install]
WantedBy=graphical.target