Skip to content

Commit

Permalink
systemd: configure MOJO_TMP_DIR=/tmp/mirrorcache
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-suse committed Oct 23, 2024
1 parent 5f1b8ae commit 31f0764
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/rpm/MirrorCache-tmpfilesd.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Type Path Mode UID GID Age Argument
d /var/lib/mirrorcache 0750 mirrorcache mirrorcache - -
d /run/mirrorcache 0750 mirrorcache mirrorcache - -
r /tmp/mojo.tmp.* - mirrorcache mirrorcache 8h
d /tmp/mirrorcache - mirrorcache mirrorcache 8h
2 changes: 2 additions & 0 deletions dist/systemd/mirrorcache-backstage-hashes.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Unit]
Description=MirrorCache daemon for file hashes calculation jobs
After=systemd-tmpfiles-setup.service postgresql.service mariadb.service

[Service]
User=mirrorcache
Expand All @@ -11,6 +12,7 @@ RestartSec=10
EnvironmentFile=/etc/mirrorcache/conf.env
EnvironmentFile=-/etc/mirrorcache/conf-hashes.env
WorkingDirectory=/var/lib/mirrorcache
Environment="MOJO_TMPDIR=/tmp/mirrorcache"

[Install]
WantedBy=multi-user.target
3 changes: 2 additions & 1 deletion dist/systemd/mirrorcache-backstage.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=MirrorCache daemon for background jobs
After=postgresql.service
After=systemd-tmpfiles-setup.service postgresql.service mariadb.service

[Service]
User=mirrorcache
Expand All @@ -11,6 +11,7 @@ Restart=on-failure
RestartSec=10
EnvironmentFile=/etc/mirrorcache/conf.env
WorkingDirectory=/var/lib/mirrorcache
Environment="MOJO_TMPDIR=/tmp/mirrorcache"

[Install]
WantedBy=multi-user.target
3 changes: 2 additions & 1 deletion dist/systemd/mirrorcache-hypnotoad.service
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Unit]
Description=MirrorCache webApp
After=systemd-tmpfiles-setup.service postgresql.service mariadb.service nss-lookup.target
Before=apache2.service
After=postgresql.service mariadb.service nss-lookup.target

[Service]
User=mirrorcache
Expand All @@ -13,6 +13,7 @@ ExecReload=/usr/share/mirrorcache/script/mirrorcache-hypnotoad
EnvironmentFile=/etc/mirrorcache/conf.env
KillMode=process
WorkingDirectory=/var/lib/mirrorcache
Environment="MOJO_TMPDIR=/tmp/mirrorcache"

[Install]
WantedBy=multi-user.target
3 changes: 2 additions & 1 deletion dist/systemd/mirrorcache-subtree.service
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Unit]
Description=MirrorCache subtree webApp
After=systemd-tmpfiles-setup.service postgresql.service mariadb.service nss-lookup.target
Before=apache2.service
After=postgresql.service mariadb.service nss-lookup.target

[Service]
User=mirrorcache
Expand All @@ -10,6 +10,7 @@ EnvironmentFile=-/etc/mirrorcache/conf.env
EnvironmentFile=/etc/mirrorcache/conf-subtree.env
ExecStart=/usr/share/mirrorcache/script/mirrorcache-daemon
WorkingDirectory=/var/lib/mirrorcache
Environment="MOJO_TMPDIR=/tmp/mirrorcache"

[Install]
WantedBy=multi-user.target
3 changes: 2 additions & 1 deletion dist/systemd/mirrorcache.service
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[Unit]
Description=MirrorCache webApp
After=systemd-tmpfiles-setup.service postgresql.service mariadb.service nss-lookup.target
Before=apache2.service
After=postgresql.service mariadb.service nss-lookup.target

[Service]
User=mirrorcache
Group=mirrorcache
ExecStart=/usr/share/mirrorcache/script/mirrorcache-daemon
EnvironmentFile=/etc/mirrorcache/conf.env
WorkingDirectory=/var/lib/mirrorcache
Environment="MOJO_TMPDIR=/tmp/mirrorcache"

[Install]
WantedBy=multi-user.target
4 changes: 2 additions & 2 deletions t/lib/test-in-container-systemd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ podman_info="$($PODMAN info >/dev/null 2>&1)" || {
mkdir -p $thisdir/src
cp $thisdir/../data/city.mmdb $thisdir/src/

$PODMAN build -t $ident.image -f $thisdir/Dockerfile.systemd.$MIRRORCACHE_DB_PROVIDER $thisdir
$PODMAN build --net=host -t $ident.image -f $thisdir/Dockerfile.systemd.$MIRRORCACHE_DB_PROVIDER $thisdir

map_port=""
[ -z "$EXPOSE_PORT" ] || map_port="-p $EXPOSE_PORT:80"
$PODMAN run --privileged $map_port --rm --name "$containername" -d -v"$thisdir/../..":/opt/project -e MIRRORCACHE_DB_PROVIDER=$MIRRORCACHE_DB_PROVIDER -- $ident.image
$PODMAN run --net=host --privileged $map_port --rm --name "$containername" -d -v"$thisdir/../..":/opt/project -e MIRRORCACHE_DB_PROVIDER=$MIRRORCACHE_DB_PROVIDER -- $ident.image

in_cleanup=0

Expand Down

0 comments on commit 31f0764

Please sign in to comment.