~postmarketos/pmbootstrap-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH pmbootstrap] pmb.helpers.run: fix sudo timer

Details
Message ID
<20230605092217.725218-1-luca@z3ntu.xyz>
DKIM signature
missing
Download raw message
Patch: +2 -2
The recent changes to the sudo code forgot this usage here which broke
with the sudo timer config option enabled.

Fixes: d31313f7 ("Don't use 'sudo' when running as root")
---
 pmb/helpers/run_core.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pmb/helpers/run_core.py b/pmb/helpers/run_core.py
index 5bf5327b..3cd5a5a2 100644
--- a/pmb/helpers/run_core.py
+++ b/pmb/helpers/run_core.py
@@ -227,10 +227,10 @@ def sudo_timer_iterate():
    Run sudo -v and schedule a new timer to repeat the same.
    """

    if pmb.config.sudo == "sudo":
    if pmb.config.which_sudo() == "sudo":
        subprocess.Popen(["sudo", "-v"]).wait()
    else:
        subprocess.Popen([pmb.config.sudo, "true"]).wait()
        subprocess.Popen(pmb.config.sudo("true")).wait()

    timer = threading.Timer(interval=60, function=sudo_timer_iterate)
    timer.daemon = True
-- 
2.40.1

[pmbootstrap/patches/.build.yml] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CT4MKZA9R1NI.2MXM4J30D68OO@cirno2>
In-Reply-To
<20230605092217.725218-1-luca@z3ntu.xyz> (view parent)
DKIM signature
missing
Download raw message
pmbootstrap/patches/.build.yml: FAILED in 8m15s

[pmb.helpers.run: fix sudo timer][0] from [Luca Weiss][1]

[0]: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/41655
[1]: luca@z3ntu.xyz

✗ #1001694 FAILED pmbootstrap/patches/.build.yml https://builds.sr.ht/~postmarketos/job/1001694
Details
Message ID
<CT4NW4KW367E.1CK7AIN86O4BS@pm-mail-aerc>
In-Reply-To
<20230605092217.725218-1-luca@z3ntu.xyz> (view parent)
DKIM signature
missing
Download raw message
On Mon Jun 5, 2023 at 11:22 AM CEST, Luca Weiss wrote:
> The recent changes to the sudo code forgot this usage here which broke
> with the sudo timer config option enabled.
>
> Fixes: d31313f7 ("Don't use 'sudo' when running as root")

Thanks!

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>

> ---
>  pmb/helpers/run_core.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/pmb/helpers/run_core.py b/pmb/helpers/run_core.py
> index 5bf5327b..3cd5a5a2 100644
> --- a/pmb/helpers/run_core.py
> +++ b/pmb/helpers/run_core.py
> @@ -227,10 +227,10 @@ def sudo_timer_iterate():
>      Run sudo -v and schedule a new timer to repeat the same.
>      """
>  
> -    if pmb.config.sudo == "sudo":
> +    if pmb.config.which_sudo() == "sudo":
>          subprocess.Popen(["sudo", "-v"]).wait()
>      else:
> -        subprocess.Popen([pmb.config.sudo, "true"]).wait()
> +        subprocess.Popen(pmb.config.sudo("true")).wait()
>  
>      timer = threading.Timer(interval=60, function=sudo_timer_iterate)
>      timer.daemon = True
> -- 
> 2.40.1
Details
Message ID
<168596393294.2614.14487732461770063999.b4-ty@postmarketos.org>
In-Reply-To
<20230605092217.725218-1-luca@z3ntu.xyz> (view parent)
DKIM signature
missing
Download raw message
On Mon, 05 Jun 2023 11:22:17 +0200, Luca Weiss wrote:
> The recent changes to the sudo code forgot this usage here which broke
> with the sudo timer config option enabled.
> 
> 

Applied, thanks!

[1/1] pmb.helpers.run: fix sudo timer
      commit: 1d0eb2792fa0a808f0a5f4d47b61d8d48967630f

Best regards,
-- 
Oliver Smith <ollieparanoid@postmarketos.org>
Reply to thread Export thread (mbox)