Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id AFA64782BA2 for <~alpine/users@lists.alpinelinux.org>; Fri, 24 Apr 2020 14:30:03 +0000 (UTC) X-Originating-IP: 81.14.30.15 Received: from [192.168.3.37] (15.30.14.81.rev.sfr.net [81.14.30.15]) (Authenticated sender: michel.piquemal@ipik.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 06BBD60011 for <~alpine/users@lists.alpinelinux.org>; Fri, 24 Apr 2020 14:30:01 +0000 (UTC) From: spam@ipik.org Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.5\)) Subject: struggling with apk in unattended session Message-Id: Date: Fri, 24 Apr 2020 16:29:39 +0200 To: ~alpine/users@lists.alpinelinux.org X-Mailer: Apple Mail (2.3445.9.5) Hi, I=E2=80=99m trying to run apk command in an embedded system under no = end-user console/ssh interaction. The set of scripts running the apk command works great when launched from ssh session (produces output and log), or for instance, if it is gated by an acpid input device (thus under root) However, when launched by another process ( owned by user =E2=80=9Cjoe=E2=80= =9D, who has sudo rights on script), apk command seems to block: other preceding commands do produce expected results and logs, but it stumbles on apk. Are there any special consideration to take care about with apk in such scenario? Thanks for any tip! macmpi Some code snippets to explain: Result: stuff1 & stuff 3 are performed (so setup-mystuff entry passes the sudo test!), but apk, stuff4 (and stuff2) never happen, and no trace appear on /tmp/update.log nor /var/log/messages cat /usr/local/bin/update #!/bin/sh # do stuff1 here ./setup-mystuff > /tmp/update.log 2>&1 # do stuff2 here cat /tmp/setup-mystuff #!/bin/sh ! [ $(id -u) =3D 0 ] && { echo >&2 "Please run as root"; exit 1; } # do stuff3 here apk add # do stuff4 here sudo visudo -f /etc/sudoers.d/010_joe-nopasswd joe ALL=3D(root) NOPASSWD: /usr/local/bin/update=