mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 06:32:00 -03:30
nc-nextcloud.sh, ncp-provisioning.sh: Implement nextcloud service workers
This commit is contained in:
parent
9c54a8a177
commit
5b11ae0caf
@ -82,5 +82,13 @@ EOF
|
|||||||
cat /usr/local/etc/instance.cfg
|
cat /usr/local/etc/instance.cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
systemctl is-enabled -q nextcloud-ai-worker@1.service || {
|
||||||
|
max="$(nproc || echo '2')"
|
||||||
|
max="$((max-1))"
|
||||||
|
for i in $(seq 1 "$max")
|
||||||
|
do
|
||||||
|
systemctl enable --now "nextcloud-ai-worker@${i}.service"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@ -83,6 +83,25 @@ EOF
|
|||||||
update-rc.d redis-server enable
|
update-rc.d redis-server enable
|
||||||
clear_opcache
|
clear_opcache
|
||||||
|
|
||||||
|
# NC service workers
|
||||||
|
cat > /etc/systemd/system/nextcloud-ai-worker@.service <<'EOF'
|
||||||
|
[Unit]
|
||||||
|
Description=Nextcloud AI worker %i
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=php occ background-job:worker -t 60 'OC\\TaskProcessing\\SynchronousBackgroundJob'
|
||||||
|
Restart=always
|
||||||
|
StartLimitInterval=60
|
||||||
|
StartLimitBurst=10
|
||||||
|
WorkingDirectory=/var/www/nextcloud
|
||||||
|
User=www-data
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
# service to randomize passwords on first boot
|
# service to randomize passwords on first boot
|
||||||
mkdir -p /usr/lib/systemd/system
|
mkdir -p /usr/lib/systemd/system
|
||||||
cat > /usr/lib/systemd/system/nc-provisioning.service <<'EOF'
|
cat > /usr/lib/systemd/system/nc-provisioning.service <<'EOF'
|
||||||
|
|||||||
@ -5,4 +5,27 @@ then
|
|||||||
ncc app:disable app_api
|
ncc app:disable app_api
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cat > /etc/systemd/system/nextcloud-ai-worker@.service <<'EOF'
|
||||||
|
[Unit]
|
||||||
|
Description=Nextcloud AI worker %i
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=php occ background-job:worker -t 60 'OC\\TaskProcessing\\SynchronousBackgroundJob'
|
||||||
|
Restart=always
|
||||||
|
StartLimitInterval=60
|
||||||
|
StartLimitBurst=10
|
||||||
|
WorkingDirectory=/var/www/nextcloud
|
||||||
|
User=www-data
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
max="$(nproc || echo '2')"
|
||||||
|
max="$((max-1))"
|
||||||
|
for i in $(seq 1 "$max")
|
||||||
|
do
|
||||||
|
systemctl enable --now "nextcloud-ai-worker@${i}.service"
|
||||||
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
Loading…
x
Reference in New Issue
Block a user