Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.

Bug 1520477

Summary: niceload command completely broken in F27
Product: [Fedora] Fedora Reporter: Bert DeKnuydt <Bert.Deknuydt>
Component: parallelAssignee: Golo Fuchert <packages>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 27CC: packages, walters
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: parallel-20180322-1.fc27 parallel-20180322-1.fc28 parallel-20180322-1.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-26 21:17:10 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Bert DeKnuydt 2017-12-04 09:45:06 EST
Description of problem:

In Fedora 27, the 'niceload' command is no functioning at all.

Version-Release number of selected component (if applicable):

parallel-20160722-3.fc26.noarch

How reproducible:

Always

Steps to Reproduce:
1. niceload -n 2 sleep 30
2.
3.

Actual results:

In Fedora 27:
---
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/vm\.loadavg: { <-- HERE  ([0-9.]+) ([0-9.]+) ([0-9.]+) }/ at /usr/bin/niceload line 1022.
(exit and error)
---


In Fedora 26:
---
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/vm\.loadavg: { <-- HERE  ([0-9.]+) ([0-9.]+) ([0-9.]+) }/ at /usr/bin/niceload line 1022.
(and the command runs)
---

This is due to a literal { in a regular expressions being deprecated since perl 5.22 and simply flagged as errors
from perl 5.26. F26 has 5.24, while F27 has 5.26.

Expected results:

Function as described in the man page.

Additional info:

I guess two options ...

*) Quick fix:

Edit line 1022 and escape the left brace with a backslash:

---------------------------
--- /usr/bin/niceload.orig      2017-12-04 09:58:56.968454067 +0100
+++ /usr/bin/niceload   2017-12-04 09:59:15.182548403 +0100
@@ -1019,7 +1019,7 @@
 
 sub load_status_darwin {
     my $loadavg = `sysctl vm.loadavg`;
-    if($loadavg =~ /vm\.loadavg: { ([0-9.]+) ([0-9.]+) ([0-9.]+) }/) {
+    if($loadavg =~ /vm\.loadavg: \{ ([0-9.]+) ([0-9.]+) ([0-9.]+) }/) {
        $loadavg = $1;
     } elsif (open(IN,"LANG=C uptime|")) {
        my $upString = <IN>;
--------------------------

*) Other fix:

Update to upstream version parallel-20170206.
Comment 1 Fedora Update System 2018-04-15 00:10:28 EDT
parallel-20180322-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-bfe7526175
Comment 2 Fedora Update System 2018-04-15 00:10:39 EDT
parallel-20180322-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-aea2d04f19
Comment 3 Fedora Update System 2018-04-15 00:10:45 EDT
parallel-20180322-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-61299d188b
Comment 4 Fedora Update System 2018-04-16 23:02:39 EDT
parallel-20180322-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-bfe7526175
Comment 5 Fedora Update System 2018-04-17 22:28:48 EDT
parallel-20180322-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-aea2d04f19
Comment 6 Fedora Update System 2018-04-17 22:57:57 EDT
parallel-20180322-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-61299d188b
Comment 7 Fedora Update System 2018-04-26 21:17:10 EDT
parallel-20180322-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2018-04-27 00:03:17 EDT
parallel-20180322-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2018-04-27 07:17:29 EDT
parallel-20180322-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.