Systemd user service added

This commit is contained in:
Brandon Rozek 2024-01-07 18:48:13 -05:00
parent 81b7b16c3f
commit ee214b7986
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480
2 changed files with 31 additions and 0 deletions

View file

@ -38,6 +38,20 @@ figure out the word for all future days.
You can reset the seed and all game state by removing the file `state.pickle`. You can reset the seed and all game state by removing the file `state.pickle`.
A systemd service file is provided under `wordguess.service` in order to provide another way to run the server.
Copy `wordguess.service` to `~/.config/systemd/user` and then enable and start the service with:
```bash
systemctl --user enable --now wordguess
```
To start on boot-up, your user needs to have `Linger` enabled. If you have root access, you can run:
```bash
sudo loginctl enable-linger $USER
```
## Players ## Players
Players can play the game by running the `client.py` python script. Players can play the game by running the `client.py` python script.
@ -55,3 +69,8 @@ python /home/wg/WordGuess/leaderboard.py
``` ```
You can also pass a date with `--date`. You can also pass a date with `--date`.
## Notes
Word list from [Morgenstern2573/wordle_clone](https://github.com/Morgenstern2573/wordle_clone/blob/master/build/words.js) on GitHub.

12
wordguess.service Normal file
View file

@ -0,0 +1,12 @@
[Unit]
Description=WordGuess server
Requires=
After=
[Service]
Type=simple
WorkingDirectory=%h/WordGuess/
ExecStart=/usr/bin/python server.py
[Install]
WantedBy=multi-user.target