diff -Nru open-build-service-2.9.4/debian/changelog open-build-service-2.9.4/debian/changelog --- open-build-service-2.9.4/debian/changelog 2022-10-16 09:07:52.000000000 +0000 +++ open-build-service-2.9.4/debian/changelog 2023-03-23 13:09:20.000000000 +0000 @@ -1,3 +1,40 @@ +open-build-service (2.9.4-9) unstable; urgency=medium + + * Use PrivateMounts=true to clean up proc/sys/dev mounts on restart. + If interrupted at a wrong time, obs-worker leaves proc/sys/dev mounted + in a chroot, and later, when restarted, attempts to delete them and + fails. PrivateMounts=true ensures each worker has its own private + namespace, and when it’s stopped, all mounts go away automatically + and no cleanup is needed. + + -- Andrej Shadura Thu, 23 Mar 2023 14:09:20 +0100 + +open-build-service (2.9.4-8) unstable; urgency=medium + + * Create BSConfig.pm in autopkgtest if it’s missing. + * Remove outdated NEWS. + + -- Andrej Shadura Wed, 22 Mar 2023 11:22:02 +0100 + +open-build-service (2.9.4-7) unstable; urgency=medium + + * Make autopkgtests runnable in a container. + + -- Andrej Shadura Wed, 22 Mar 2023 07:00:05 +0100 + +open-build-service (2.9.4-6) unstable; urgency=medium + + [ Debian Janitor ] + * Apply multi-arch hints. + obs-productconverter: Add Multi-Arch: foreign. + + [ Andrej Shadura ] + * Rewrite the obsworker service unit to actually work (Closes: #1033280) + * Restart the worker on failure automatically. + * Only fix scripts in OBS package directories. + * Add autopkgtest. + + -- Andrej Shadura Tue, 21 Mar 2023 17:50:16 +0100 + open-build-service (2.9.4-5) unstable; urgency=medium * Stop removing data and users on purge (Closes: #924233). diff -Nru open-build-service-2.9.4/debian/control open-build-service-2.9.4/debian/control --- open-build-service-2.9.4/debian/control 2022-10-16 09:07:52.000000000 +0000 +++ open-build-service-2.9.4/debian/control 2023-03-23 13:09:20.000000000 +0000 @@ -75,6 +75,7 @@ Architecture: all Depends: ${misc:Depends}, ${shlibs:Depends} +Multi-Arch: foreign Description: Open Build Service (product definition utility) The obs_productconvert is a utility to create Kiwi- and Spec- files from a product definition. diff -Nru open-build-service-2.9.4/debian/NEWS open-build-service-2.9.4/debian/NEWS --- open-build-service-2.9.4/debian/NEWS 2022-10-16 09:07:52.000000000 +0000 +++ open-build-service-2.9.4/debian/NEWS 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -open-build-service (2.9.4-3) UNRELEASED; urgency=medium - - The Phusion Passenger application server was previously executed by the - 'nobody' user and now is executed by the 'obsapi' user. If you kept an - old version of /etc/apache2/sites-available/obs.conf file while upgrading, - please make sure it contains the following line: - - PassengerDefaultUser obsapi - - Otherwise the OBS rails app (API) will face some permission issues. - - -- Lucas Kanashiro Tue, 09 Apr 2019 12:23:14 -0300 - -open-build-service (2.7.1-9) unstable; urgency=medium - - SLP is no longer supported in open-build-service package: if you - have previous version installed. Please set OBS_USE_SLP="no" in - your /etc/default/obs-server conf file as slptool is sechduled to be - drop from debian. See more details on #848855. - - -- Andrew Lee (李健秋) Thu, 22 Dec 2016 14:33:17 +0800 diff -Nru open-build-service-2.9.4/debian/obs-worker.obsworker.default open-build-service-2.9.4/debian/obs-worker.obsworker.default --- open-build-service-2.9.4/debian/obs-worker.obsworker.default 2022-10-16 09:07:52.000000000 +0000 +++ open-build-service-2.9.4/debian/obs-worker.obsworker.default 2023-03-23 13:09:20.000000000 +0000 @@ -106,17 +106,17 @@ # Enable caching requires a given directory here. Be warned, content will be # removed there ! # -OBS_CACHE_DIR="" +OBS_CACHE_DIR="/var/cache/obs-worker" ## Path: Applications/OBS ## Description: Defines the package cache size ## Type: size in MB -## Default: "" +## Default: "4096" ## Config: OBS # # Set the size to 50% of the maximum usable size of this partition # -OBS_CACHE_SIZE="" +OBS_CACHE_SIZE="4096" ## Path: Applications/OBS ## Description: Defines the VM type of worker diff -Nru open-build-service-2.9.4/debian/rules open-build-service-2.9.4/debian/rules --- open-build-service-2.9.4/debian/rules 2022-10-16 09:07:52.000000000 +0000 +++ open-build-service-2.9.4/debian/rules 2023-03-23 13:09:20.000000000 +0000 @@ -27,7 +27,7 @@ debian/obs-server/etc/default/obs-server # Replace #!/usr/bin/env perl to #!/usr/bin/perl - grep -rl '/usr/bin/env perl' debian/ | xargs sed -i 's#/usr/bin/env perl#/usr/bin/perl#' + grep -rl '/usr/bin/env perl' debian/*/usr/lib/obs | xargs sed -i 's#/usr/bin/env perl#/usr/bin/perl#' # Clean up "extra" license rm debian/obs-server/usr/lib/obs/server/License diff -Nru open-build-service-2.9.4/debian/systemd/obsworker@.service open-build-service-2.9.4/debian/systemd/obsworker@.service --- open-build-service-2.9.4/debian/systemd/obsworker@.service 2022-10-16 09:07:52.000000000 +0000 +++ open-build-service-2.9.4/debian/systemd/obsworker@.service 2023-03-23 13:09:20.000000000 +0000 @@ -3,16 +3,26 @@ After=network.target [Service] +Type=simple +Environment=OBS_CACHE_SIZE=8192 +# Settings from /etc/default/obsworker override the above EnvironmentFile=/etc/default/obsworker -ExecStartPre=/bin/mkdir -p /var/cache/build/root_%i -ExecStartPre=/bin/mkdir -p /var/cache/build/state_%i -ExecStartPre=/bin/chmod 755 /var/cache/build/root_%i -ExecStartPre=/bin/chmod 755 /var/cache/build/state_%i -ExecStartPre=/bin/mkdir -p /var/cache/build/boot -ExecStartPre=/bin/chown obsworker.obsworker /var/cache/build/boot -ExecStartPre=(cd /var/cache/build/boot && /usr/bin/curl -s "http://$OBS_SERVER:5252/getworkercode" | /bin/cpio --quiet --extract && /bin/ln -s . XML) -ExecStart=/var/cache/build/boot/bs_worker --hardstatus --root /var/cache/build/root_%i --statedir /var/cache/build/state_%i --id `hostname`:%i --reposerver http://${OBS_REPO_SERVERS} --jobs $OBS_WORKER_JOBS & +WorkingDirectory=-/var/cache/build/boot_%i +RuntimeDirectory=obs-worker/%i +CacheDirectory=obs-worker +ExecStartPre=/bin/mkdir -p /var/cache/build/boot_%i +ExecStartPre=/bin/sh -c "wget -q -O - http://${OBS_REPO_SERVERS}/getworkercode | cpio -i" +ExecStartPre=/bin/chmod a+x bs_worker +ExecStartPre=/bin/rm -f XML +ExecStartPre=/bin/ln -sf . XML +ExecStartPre=/bin/mkdir -p ${OBS_WORKER_DIRECTORY}/root_%i +ExecStartPre=/bin/chmod 755 ${OBS_WORKER_DIRECTORY}/root_%i +ExecStartPre=/bin/chown obsworker:obsworker /var/cache/build/boot_%i +ExecStart=/var/cache/build/boot_%i/bs_worker --hardstatus --root /var/cache/build/root_%i --statedir %t/obs-worker/%i --id %H:%i --reposerver http://${OBS_REPO_SERVERS} --jobs ${OBS_WORKER_JOBS} --cachedir %C/obs-worker --cachesize ${OBS_CACHE_SIZE} ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure +RestartSec=5 +PrivateMounts=true [Install] WantedBy=multi-user.target diff -Nru open-build-service-2.9.4/debian/tests/control open-build-service-2.9.4/debian/tests/control --- open-build-service-2.9.4/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ open-build-service-2.9.4/debian/tests/control 2023-03-23 13:09:20.000000000 +0000 @@ -0,0 +1,3 @@ +Tests: smoke +Restrictions: isolation-container, needs-reboot, needs-root, allow-stderr, skippable +Depends: obs-worker, obs-build,systemd-sysv, cpio, busybox diff -Nru open-build-service-2.9.4/debian/tests/genbuildcode open-build-service-2.9.4/debian/tests/genbuildcode --- open-build-service-2.9.4/debian/tests/genbuildcode 1970-01-01 00:00:00.000000000 +0000 +++ open-build-service-2.9.4/debian/tests/genbuildcode 2023-03-23 13:09:20.000000000 +0000 @@ -0,0 +1,5 @@ +#!/bin/sh -x + +cd /usr/lib/obs-build + +find -type f | cpio -o -L > "$AUTOPKGTEST_TMP"/getbuildcode diff -Nru open-build-service-2.9.4/debian/tests/genworkercode open-build-service-2.9.4/debian/tests/genworkercode --- open-build-service-2.9.4/debian/tests/genworkercode 1970-01-01 00:00:00.000000000 +0000 +++ open-build-service-2.9.4/debian/tests/genworkercode 2023-03-23 13:09:20.000000000 +0000 @@ -0,0 +1,9 @@ +#!/bin/sh -x + +cd src/backend + +[ -e BSConfig.pm ] || cp BSConfig.pm.template BSConfig.pm + +cd worker + +ls *.pm worker-deltagen.spec bs_worker | cpio -o -L > "$AUTOPKGTEST_TMP"/getworkercode diff -Nru open-build-service-2.9.4/debian/tests/smoke open-build-service-2.9.4/debian/tests/smoke --- open-build-service-2.9.4/debian/tests/smoke 1970-01-01 00:00:00.000000000 +0000 +++ open-build-service-2.9.4/debian/tests/smoke 2023-03-23 13:09:20.000000000 +0000 @@ -0,0 +1,26 @@ +#!/bin/sh + +[ -d /run/systemd/system ] || exit 77 + +debian/tests/genworkercode +debian/tests/genbuildcode + +( cd "$AUTOPKGTEST_TMP" ; busybox httpd -p 5252 ) + +echo OBS_REPO_SERVERS="127.0.0.1:5252" >> /etc/default/obsworker + +set -e + +systemctl enable obsworker@1 +systemctl start obsworker@1 +sleep 10 +systemctl status obsworker@1 + +PORT=$(systemctl status obsworker@1 | grep -o "worker started on port .*" | cut -d' ' -f5) + +echo Detected: $PORT +curl -v http://0.0.0.0:$PORT/worker + +systemctl stop obsworker@1 +journalctl -xeu obsworker@1 +