Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from Capstone-Projects-2024-Spring/BP-134-Crea…
…te-script-that-runs-when-BlastPad-is-turned-on Add services for Flask server and GUI
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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* | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |