Hi, John Soo <js...@asu.edu> skribis:
> I was looking to pause a long build today and asked on IRC how to > accomplish pause/resume. It seems this is possible already with the > following: > > kill --signal SIGSTOP|SIGCONT {pids-of-build-process-tree} > > There is already a command to list the processes associated to guix > commands: guix processes. Perhaps pause/resume can be a subcommand or > set of flags to guix processes. The following is the first thing that > comes to mind: > > guix processes --pause package-name ... --resume package-name ... > > What do you think? First, note that the daemon is unaware of “packages”, it only knows about “derivations”. Second, ‘guix processes’ is nice but it uses low-level heuristics to determine what daemon sessions are open, what their clients are, and what they’re building; it resorts to heuristics because the daemon as it stands doesn’t have a way to communicate its current state. It works well in practice, but still I wouldn’t go too far building around it. Last, you’d need to send SIGTSTP to the whole process group of the build, like so (I think, haven’t tried): sudo kill -TSTP -123 where 123 is the “SessionPID” shown by ‘guix processes’. However, doing so may affect build results: processes in the build environment might handle SIGTSTP specially, which can have side effects. It’s an observable action. Conclusion: I don’t think we can implement this reliably. HTH! Ludo’.