Perhaps a better example would be
$ run-this-one /opt/bin/nuke-files --dir /path/to/clean --files-
regex "tmp|swp"
for a fictitious program named nuke-files that takes a directory to
watch and clean up and a --files-regex argument of what filenames to
delete. This command would remove all files that contain the strings
'tmp' or 'swp' in them, perhaps using 'grep' under the hood.
There is no goal to have run-this-one interpret this "tmp|swp" argument
as a regular expression so it can match multiple processes - it should
be a straight string match.
The problem is when run-this-one comes along with pgrep then this string *IS*
considered a regex and matches more processes than it should - notably the
run-this-one program itself is matched, which then gets whacked.
The linked PR just protects run-this-one from killing itself. It could
still kill other matches (i.e. it's not a perfect fix) but at least we
will run the program we're hoping to run - without a fix you can never
run a command containing a regex like this because run-this-one kills
itself before executing the intended program.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2081328
Title:
run-this-one fails on commands that include some regex patterns
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/run-one/+bug/2081328/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs