minor fixes

This commit is contained in:
Leon
2022-03-15 18:33:17 +01:00
parent 44d094c63b
commit 630a9fb924
4 changed files with 39 additions and 1 deletions

View File

@@ -62,3 +62,4 @@ $ ./podi init git@yourserver:/home/git/myapp master
## Docs
* [adding your own recipes](doc/recipes.md)
* [starting podi at server boot](doc/systemd.md)

37
doc/systemd.md Normal file
View File

@@ -0,0 +1,37 @@
basically `/podi start` is to be called some way or another
## systemd example
Many servers use systemd, so you can modify the text below and put it into `/etc/systemd/system/your-container.service`:
```
[Unit]
Description=your-container
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
User=username
Group=username
RemainAfterExit=yes
WorkingDirectory=/home/username/repository
ExecStart=/home/username/repository/podi start
ExecStop=/home/username/repository/podi stop
Type=forking
[Install]
WantedBy=multi-user.target default.target
```
and then run:
```
$ systemctl daemon-reload
$ systemctl start your-container
$ systemctl status your-container
(edit the service-file if it didn't work, and retry the 3 lines above)
$ systemctl enable your-container
```
> voila..now it will persist across reboots

1
podi
View File

@@ -3,6 +3,7 @@ set -e
required="awk ssh git hostname basename"
test -z $HOST && host=$USER@$(hostname) || host=$HOST
test -z "$RECIPE_REPOS" && RECIPE_REPOS="https://raw.githubusercontent.com/coderofsalvation/podi/master/recipe/index.txt"
test -z $PODI_APP && export PODI_APP=$(basename $(pwd))
#trap "trigger cleanup" 0 1 2 3 6
C_GREY="\\033[1;30m"
C_BOLD="\\033[1;37;40m"

View File

@@ -1,5 +1,4 @@
# info: containerized app, nice starting point for Dockerfile + app
export POD=$(which podman || which docker || echo "")
hint_systemd(){