Compare commits

..

2 Commits

Author SHA1 Message Date
Dustin fc3ef23dfa env/prod: frigate: Adjust Back Yard Pool Zone
I adjusted the orientation of the Back Yard camera slightly, so the Pool
Zone is now different.
2024-04-25 09:53:39 -05:00
Dustin beb243d69a loki: Do not chcon/chown state dir at startup
_systemd_ automatically recursively changes the ownership of the paths
listed in `StateDirectory` when the unit is activated.  This can take a
very long time, as the Loki storage directory contains hundreds of
thousands  of files.  Since we also have `podman` change the ownership,
that *doubles* the time taken.  Similarly, with `podman` also configured
to change the SELinux label of the files in that path, even more time is
wasted at startup.

To avoid all these time wasters, we need to avoid having _systemd_
manage the state directory and create it with the proper ownership and
SELinux label manually.  Here, we're only manipulating the metadata of
the top-level directory; anything within the directory is untouched.
This ensures that the directory is always there and has the correct
permissions, but does not spend any time changing anything that doesn't
need changed.
2024-04-25 09:47:21 -05:00
2 changed files with 4 additions and 3 deletions

View File

@ -271,7 +271,7 @@ _frigate: config: cameras: {
retain: default: 365 retain: default: 365
} }
zones: { zones: {
pool_zone: coordinates: "894,169,1333,136,1403,173,1265,278,1069,290,931,301,814,358,744,435,571,414,538,330" pool_zone: coordinates: "532,78,1063,21,1117,31,979,208,931,301,515,307,406,375,231,373,204,291"
} }
} }
} }

View File

@ -7,7 +7,8 @@ StartLimitIntervalSec=1m
StartLimitBurst=60 StartLimitBurst=60
[Service] [Service]
StateDirectory=%P ExecStartPre=/bin/install -o 10001 -g 10001 -d %S/%P
ExecStartPre=/bin/chcon -t container_file_t %S/%P
ExecReload=/usr/bin/podman kill --cidfile=%t/%N.cid --signal HUP ExecReload=/usr/bin/podman kill --cidfile=%t/%N.cid --signal HUP
TimeoutStartSec=5m TimeoutStartSec=5m
Restart=always Restart=always
@ -16,7 +17,7 @@ RstartSec=1s
[Container] [Container]
Image=docker.io/grafana/loki:2.9.4 Image=docker.io/grafana/loki:2.9.4
Exec=-config.file=/etc/loki/config.yml Exec=-config.file=/etc/loki/config.yml
Volume=%S/%P:/var/lib/loki:rw,Z,U Volume=%S/%P:/var/lib/loki:rw
Volume=/etc/loki:/etc/loki:ro Volume=/etc/loki:/etc/loki:ro
Network=host Network=host