Skip to content

Commit

Permalink
Merge pull request #63 from Capstone-Projects-2024-Spring/BP-134-Crea…
Browse files Browse the repository at this point in the history
…te-script-that-runs-when-BlastPad-is-turned-on

Add services for Flask server and GUI
  • Loading branch information
Snarr committed Mar 22, 2024
2 parents 13ae001 + a75d7fb commit 0abf84d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
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

0 comments on commit 0abf84d

Please sign in to comment.