Bug 789091

Summary: RFE: patch to add -h (human readable) switch to uptime command
Product: [Fedora] Fedora Reporter: David Cantrell <dcantrell>
Component: procps-ngAssignee: Jaromír Cápík <jcapik>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: fedora, jcapik, ovasik
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-03 15:52:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
procps-3.2.8-uptime-human-readable.patch none

Description David Cantrell 2012-02-09 19:25:28 UTC
Created attachment 560693 [details]
procps-3.2.8-uptime-human-readable.patch

A long time ago I wrote a program called 'up'.  The purpose of up was to display the system uptime computed beyond just the number of days.  It would show weeks, years, and decades in addition to days, hours, minutes, and seconds.

For reasons I cannot explain, a lot of people found this utility fun.  In fact, at some point it was packaged and included in Debian, but I doubt it's still there any more.

Fourteen years later, I still get emails asking about up and where the source can be found.  A couple years ago I became frustrated with these requests and decided to convert up in to a patch to the uptime command.  I did that and submitted it upstream, but never heard from them.  In fact, I haven't even seen another release of procps in years.

So I'm asking for this patch to be added to the Fedora procps package.  It's entirely pointless, but also harmless.  It adds the -h switch and shows you uptime in this fun and exciting format.  The patch is submitted upstream to the project owner listed on the SF page.  I'm attaching the patch to this bug report.

Thank you for your consideration.

Comment 1 Jaromír Cápík 2013-04-11 13:37:15 UTC
Hello David.

The patch cannot be applied as is and needs to be rewritten. But it would be much better if you could rewrite it to be applicable on the latest procps-ng sources and send the patch to the procps-ng mailing list. The old procps project has been obsoleted and it has no sense to do any future modifications in it.

Please, let me know.

Regards,
Jaromir.

Comment 2 Jaromír Cápík 2013-04-11 13:40:50 UTC
One more note ... please, try to choose a different letter for the switch. Small 'h' is usually dedicated for help. Even when it is unused at the moment, I would save it for the future.

Thx, J.

Comment 3 David Cantrell 2013-04-11 17:27:25 UTC
As an observation, it is absolutely hilarious how long it has taken for anyone to review and/or accept this patch.  I first wrote it in 2008.  And the patch was a rewrite of a program I originally wrote in 1998 called "up" that would print the uptime in the slightly different format.  I wanted to merge the functionality of that program in to procps.

I know the upstream procps has been abandoned, so I rewrote it for the new one.  I even filed a merge request for it.  The new upstream accepted the patch over a year ago in to the libproc1 branch:

https://gitorious.org/procps/procps/merge_requests/2

The rewritten patch uses the -p switch for "pretty print".  I really don't care what the switch is called.  That's a 2 second change.  The change to the code itself is also extremely simple and easy to follow.

I have lost hope in this patch ever making it in to procps.  It's been 5 years and clearly no one cares.  I have been maintaining my own procps fork so that I can use the patch on my systems.  It would be nice if the patch was merged, but I'm fairly confident it will never happen at this point.

Comment 4 Jaromír Cápík 2013-04-15 16:44:31 UTC
Hi David.

I see you're a bit frustrated by that. I became the new component owner 1 and half years ago and now trying to get rid of all issues and forgotten requests. Let me look at the code changes and discuss that with the guys.

Regards,
Jaromir.

Comment 5 David Cantrell 2013-05-23 12:40:27 UTC
Here's the commit that procps-ng accepted (after I rewrote the patch I submitted to the now abandoned sourceforge procps project):

http://gitorious.org/procps/procps/commit/3e7f78d296e610922daa7e144f52a77392705563

I made multiple attempts to contact the former maintainer as noted on the sourceforge page and never heard anything back.  When procps-ng appeared on gitorious, I updated my patch and it was merged....except to a different branch.  I'm not sure if libproc1 will ever make it in to releases.  I've been running a patched procps on my owned systems for almost 15 years and have never had a problem.  It would ne nice to see this changed actually accepted.

Comment 6 Jaromír Cápík 2013-05-24 12:40:21 UTC
Hi David.

I sent a question to the list few minutes ago. Let's wait for the answer from Craig or Jim. As Craig was the guy, who closed the merge request, he should know the reason, why the feature is still waiting for being merged to master. AFAIK the library API changed several times during the last year, so ... the API incompatibility shouldn't be the reason for delayed inclusion. It seems to me the whole libproc1 branch was somehow forgotten, but let's wait. Maybe I'm wrong and there really is some reason for delaying this feature. If this is really because of the API, we could do a simple modification, that would only add a new function sprint_uptime_human_readable (or something similar) instead of modifying the currently present sprint_uptime.

Regards,
Jaromir.

Comment 7 Jaromír Cápík 2013-06-03 14:51:23 UTC
Hi David.

Like I thought, the upstream merge request was forgotten by accident. We agreed that merge requests need to stay open until the feature gets in the master branch. I've reopened the request and hopefully we'll see it merged in the next release.

Regards,
Jaromir.

Comment 8 Jaromír Cápík 2014-02-03 15:52:38 UTC
Merged upstream as 'uptime -p' and available since procps-ng-3.3.9 ... should be in the current rawhide/f21. Closing.