Fix service
This commit is contained in:
@@ -51,10 +51,11 @@ in
|
|||||||
value = {
|
value = {
|
||||||
description = "Run ${containerSet.name} setup";
|
description = "Run ${containerSet.name} setup";
|
||||||
after = [ "podman-${containerSet.name}-${containerSet.setup.trigger}.service" ];
|
after = [ "podman-${containerSet.name}-${containerSet.setup.trigger}.service" ];
|
||||||
requires = [ "podman-${containerSet.name}-${containerSet.setup.trigger}.service" ];
|
wants = [ "podman-${containerSet.name}-${containerSet.setup.trigger}.service" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
|
TimeoutStartSec = "30s";
|
||||||
ExecStart = "${containerSet.setup.script}";
|
ExecStart = "${containerSet.setup.script}";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
User = "root";
|
User = "root";
|
||||||
|
|||||||
@@ -60,14 +60,14 @@ in {
|
|||||||
trigger="server";
|
trigger="server";
|
||||||
script = pkgs.writeShellScript "setup" ''
|
script = pkgs.writeShellScript "setup" ''
|
||||||
# Define the command wrapper
|
# Define the command wrapper
|
||||||
OCC="${pkgs.podman}/bin/podman exec -u www-data nextcloud php occ"
|
OCC="${pkgs.podman}/bin/podman exec -u www-data nextcloud-server php occ"
|
||||||
|
|
||||||
echo "Waiting for Nextcloud container to start..."
|
echo "Waiting for Nextcloud container to start..."
|
||||||
until $OCC status > /dev/null 2>&1; do
|
until $OCC status > /dev/null 2>&1; do
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Maintenance ..."
|
echo "Maintenance..."
|
||||||
$OCC maintenance:repair --include-expensive --non-interaction
|
$OCC maintenance:repair --include-expensive --non-interaction
|
||||||
$OCC db:add-missing-indices --non-interaction
|
$OCC db:add-missing-indices --non-interaction
|
||||||
|
|
||||||
@@ -77,6 +77,8 @@ in {
|
|||||||
$OCC config:system:set phone_region --value="CH"
|
$OCC config:system:set phone_region --value="CH"
|
||||||
$OCC config:app:set core backgroundjobs_mode --value="cron"
|
$OCC config:app:set core backgroundjobs_mode --value="cron"
|
||||||
|
|
||||||
|
|
||||||
|
echo "Completed Setup"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user