diff --git a/src/blog/posts/2024/5/learning-go-day-8.md b/src/blog/posts/2024/5/learning-go-day-8.md index 94db189..fbb9eb4 100644 --- a/src/blog/posts/2024/5/learning-go-day-8.md +++ b/src/blog/posts/2024/5/learning-go-day-8.md @@ -142,4 +142,12 @@ I can't overwrite a file while it's in use. Instead, I have to stop the service, run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -o RemoteCommand="systemctl --user start oopsie.service" ``` -And that works! It deploys successfully. Ironically, there's a minor bit of downtime while it does, but for now that's really not an issue. You can see the project in progress on [its deployed home](https://oopsie.lewisdale.dev) or [on the Git repo](https://git.lewisdale.dev/lewis/oopsie). \ No newline at end of file +And that works! It deploys successfully. Ironically, there's a minor bit of downtime while it does, but for now that's really not an issue. You can see the project in progress on [its deployed home](https://oopsie.lewisdale.dev) or [on the Git repo](https://git.lewisdale.dev/lewis/oopsie). + +## Still no! + +I went back to check on my deployed service before this post was scheduled to go out, and noticed I was getting a `502 Bad Gateway` error. My initial thought was that I had two services using port `8000`, but logging in with SSH and running `curl http://localhost:8000` returned nothing. Then I noticed when I tried to run `systemctl --user status oopsie.service`, I got an error: `Failed to connect to bus: No such file or directory`. So, I turned to Google, and found [this Superuser answer](https://superuser.com/a/1598351). + +The TL;DR is that the `systemctl` process for the user I'm running Oopsie with is being terminated. I can either run the process as root, which I'm not going to do because this user is one I specifically use for SSH via CI, so I don't want it to have anything close to sudo access. Instead, I can do `sudo loginctl enable-linger `, which means that the `systemctl` process should remain even after the user's session has been terminated. Hopefully. + +At the time of writing it's been about 10 minutes and the process is still live, so I'm hopeful this is the case. If not, one of my next posts will be about using Docker to run it instead. \ No newline at end of file