Package: moreutils
Version: 0.62-1
Severity: wishlist
Tags: upstream

I'd like to propose a new program be added to more utils, named
`waitpid`, which does a similar task than the `wait` shell builtin,
except it's not restricted to sub-processes. My dumb implementation is
a simple shell script that waits on the PID like so:

    #!/bin/sh
    
    while [ -e /proc/$1 ]; do
        sleep 1
    done

We could add all sorts of bells and whistles on top of that
(e.g. customize the loop time, rewrite in Perl or Python) but I think
that would be overthinking it.

I'm using the above regularly now in combination to `undistract-me` to
notify me of long-running tasks on remote servers. If you don't have
`undistract-me` installed, this would be the equivalent:

    ssh remote waitpid 1234 ; notify-send 'process finished'

I'd be happy to work on a patch to moreutils to include this,
including a simple manpage.

Let me know if it makes sense.

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-2-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages moreutils depends on:
ii  libc6            2.28-7
ii  libipc-run-perl  20180523.0-1
ii  perl             5.28.1-4

moreutils recommends no packages.

Versions of packages moreutils suggests:
ii  libtime-duration-perl  1.20-1
ii  libtimedate-perl       2.3000-2

-- debconf-show failed

Reply via email to