You are not logged in.

#1 2021-04-28 11:11:36

valandil
Member
Registered: 2008-03-11
Posts: 77

Running makechrootpkg without password prompts

I am trying to write a short script that builds multiple AUR packages, the later ones depending on the prior ones in the list. I am building these packages in a clean chroot.

Unfortunately, makechrootpkg prompts for a sudo password, which I would like to avoid, as I would prefer not to be in front of my computer the whole time that gcc builds smile

Is there a way to use devtools without sudo, or is there a minimal set of commands I could add to sudoers so that I could build my AUR packages in a clean chroot unattended?

Offline

#2 2021-04-28 16:27:42

Alad
Wiki Admin/IRC Op/TU
From: Bagelstan
Registered: 2014-05-04
Posts: 2,171
Website

Re: Running makechrootpkg without password prompts

archie ALL = (root) NOPASSWD: SETENV: /usr/bin/makechrootpkg
archie ALL = (root) NOPASSWD: /usr/bin/mkarchroot, /usr/bin/arch-nspawn

Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Honest Alad's Package Emporium—Now with added bugs! (Grand reopening: December 1st 2018)

Offline

#3 2021-05-01 17:50:14

valandil
Member
Registered: 2008-03-11
Posts: 77

Re: Running makechrootpkg without password prompts

Thanks for this!

Since this is a script that I always call manually, I ended up doing this (taken from SO360201 and SO625645).

# Kill background jobs started by this script.                                                                                                                                                 
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT

# Cache sudo credentials                                                                                                                                                                       
sudo -v
while sleep 180; do sudo -v; done &

<rest of the script>

Last edited by valandil (2021-05-01 18:13:41)

Offline

Board footer

Powered by FluxBB