← Back to team overview

debcrafters-packages team mailing list archive

[Bug 2081328] Re: run-this-one fails on commands that include some regex patterns

 

** Changed in: run-one (Ubuntu)
   Importance: Undecided => Wishlist

** Tags added: dcr-freezer

-- 
You received this bug notification because you are a member of
Debcrafters packages, which is subscribed to run-one in Ubuntu.
https://bugs.launchpad.net/bugs/2081328

Title:
  run-this-one fails on commands that include some regex patterns

Status in run-one package in Ubuntu:
  Triaged

Bug description:
  pgrep could get confused when the command contains regular expressions
  that match the run-* command itself, e.g. an argument like "run-this-
  one foo 'a|b'"

  PR at https://github.com/dustinkirkland/run-one/pull/1

  
  ----- Copied from PR (formatting suffers) -----

  
  $ cat /tmp/sleepforever
  #!/bin/bash
  echo Sleeping for 99 days...
  sleep +99d


  # version in HEAD
  $ run-this-one /tmp/sleepforever
  Sleeping for 99 days...
  <ctrl-c>

  $ run-this-one /tmp/sleepforever  "a|b"
  Terminated

  
  Run with -x you find the problem is this:

  
  + base=run-this-one
  + ps=/tmp/sleepforever a|b
  + pgrep -u wbagg -f ^/tmp/sleepforever a|b$
  + kill 768759
  Terminated

  
  pgrep is matching our run-this-one command and itself. The $$ check verifies that we don't kill run-this-one, the ps addition assures we don't kill the (no longer running) pgrep.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/run-one/+bug/2081328/+subscriptions