I'm programming in python on linux, and I am using multiprocessing_pool.apply_async to call a bash script using subprocess.check_output
The bash script is calling alien and rpmbuild. The alien command needs to run as root, and because of this the rpmbuild command does also, following a root sed command to correct some rpm idiosyncrasies.
At the moment, if I want to convert several debs to rpms, I have to enter my admin password, several times.
Is there a way that I can enter my admin password only once? ie that the script is always called with its different variables as new processes, but always elevated privileges following one password entry? At the moment I am using pkexec to call the script with sudo being used in the script itself.
Many thanks