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

[SYSTEMD] updated last few files from pi to ubuntu #274

Merged
merged 2 commits into from
Mar 7, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/pull_request_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
# First, we check out the repository's code using the Github Actions' "Checkout" tool.
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: 'recursive'

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
sudo chown root:root /usr/bin/tar && sudo chmod u+s /usr/bin/tar
- name: Cache protobuf-c
id: cache-protobuf-c
uses: actions/cache@v3 # Uses the Github Actions' "Cache" tool
uses: actions/cache@v4 # Uses the Github Actions' "Cache" tool
with:
# These are the files we cache
path: |
Expand All @@ -74,6 +74,15 @@ jobs:
run: |
sudo chown runner:runner /usr/bin/tar && sudo chmod u+x /usr/bin/tar

# Before we build Runtime, we check the formatting
- name: Debug
run: |
ls
pwd
- name: Format
run: |
./runtime format check

# This if statement determine whether the cache lookup was a hit (true) or miss (not true--idk, false doesn't work)
# If the cache lookup hit, we just run "sudo ldconfig" to tell the linker where to look for
# protobuf-c files. If the cache lookup missed, we have to install protobuf-c from scratch
Expand All @@ -89,11 +98,6 @@ jobs:
tar -xzf protobuf-c-1.4.1.tar.gz
cd protobuf-c-1.4.1 && ./configure && make && sudo make install && sudo ldconfig

# Before we build Runtime, we check the formatting
- name: Format
run: |
./runtime format check

# Now that we are done installing Runtime's dependencies, we build Runtime
- name: Build
run: |
Expand Down
6 changes: 3 additions & 3 deletions systemd/ngrok.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ After=net_handler.service

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/runtime/systemd/
User=ubuntu
WorkingDirectory=/home/ubuntu/runtime/systemd/
ExecStartPre=/bin/sleep 1
ExecStart=/home/pi/runtime/systemd/ngrok.sh
ExecStart=/home/ubuntu/runtime/systemd/ngrok.sh
ExecReload=/bin/kill -SIGINT $MAINPID

[Install]
Expand Down
4 changes: 2 additions & 2 deletions systemd/ngrok.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

function sigint_handler {
pkill -u pi /home/pi/ngrok
pkill -u ubuntu /home/ubuntu/ngrok
}

trap 'sigint_handler' INT

nohup /home/pi/ngrok start --all --config /home/pi/runtime/systemd/ngrok.yml > /dev/null
nohup /home/ubuntu/ngrok start --all --config /home/ubuntu/runtime/systemd/ngrok.yml > /dev/null
4 changes: 2 additions & 2 deletions systemd/ngrok_displayer.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Description=Serves a webpage that displays the ngrok tunnel IP addresses.

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/runtime/systemd/
User=ubuntu
WorkingDirectory=/home/ubuntu/runtime/systemd/
ExecStart=python3 ngrok_displayer.py
ExecReload=/bin/kill -SIGINT $MAINPID

Expand Down
4 changes: 2 additions & 2 deletions systemd/set_time.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Description=Sets the time on this raspberry pi when on CalVisitor
[Service]
Type=oneshot
User=root
WorkingDirectory=/home/pi
ExecStart=/home/pi/runtime/systemd/set_time.sh
WorkingDirectory=/home/ubuntu
ExecStart=/home/ubuntu/runtime/systemd/set_time.sh
KillSignal=SIGINT

[Install]
Expand Down