Bug 1189877 - usleep - start to display deprecation warning
Summary: usleep - start to display deprecation warning
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 26
Hardware: All
OS: Linux
high
low
Target Milestone: ---
Assignee: David Kaspar // Dee'Kej
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-05 17:17 UTC by Lukáš Nykrýn
Modified: 2018-07-13 02:06 UTC (History)
12 users (show)

Fixed In Version: initscripts-9.72-1.fc26
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-30 19:16:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1494168 0 unspecified CLOSED usleep: warning: use sleep(1) instead... 2021-02-22 00:41:40 UTC

Internal Links: 1494168

Description Lukáš Nykrýn 2015-02-05 17:17:24 UTC
Description of problem:
usleep binary is currently in initscripts package and if we want to get rid of that package this needs to be moved elsewhere.

And since coreutils already have sleep...

Comment 1 Pádraig Brady 2015-02-05 18:46:03 UTC
Well this wouldn't go upstream as usleep is only available on RH flavored linux.
I suppose downstream we could provide a script to wrap sleep(1) ?
though it would be nice to get users to convert to using sleep(1).

A script like the following would work:

exec sleep $(printf '%s\n' scale=9 "${1-0}/1000000" | bc;)

Comment 2 Ondrej Vasik 2015-02-06 10:58:04 UTC
As Pádraig said, this would be no-go for upstream. And I'm not very keen about having this as coreutils downstream wrapper (as this one would introduce requirements for bc).

Comment 3 Yanko Kaneti 2015-02-06 13:34:37 UTC
Perhaps separate it in a standalone package with all kinds of depecation doc warnings about using a recent enough coreutils "sleep" instead

Comment 4 Jaroslav Reznik 2015-03-03 16:50:14 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 5 Fedora Admin XMLRPC Client 2016-06-13 09:05:15 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Fedora End Of Life 2016-07-19 12:46:52 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Kamil Dudka 2016-07-19 13:16:26 UTC
While this is not a bug of coreutils, we need to deal with it some how.  I am reopening it and moving back to rawhide...

Comment 8 Kamil Dudka 2016-07-19 14:34:36 UTC
I like the solution proposed in comment #1.  The dependency on bc can be solved by using a separate subpackage coreutils-usleep providing the wrapper script only.  I would make the script print a deprecation warning to stderr each time it runs to educate users how to sleep in a portable way.

Is the above plan acceptable?

Comment 9 Jan Kurik 2016-07-26 04:30:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 10 Kamil Dudka 2017-04-28 17:00:48 UTC
Per suggestion in comment #1, I have prepared the coreutils-usleep subpakcage for review:

https://src.fedoraproject.org/cgit/rpms/coreutils.git/commit/?id=751b223b

I have also prepared a copr repository that includes patched initscripts:

https://copr.fedorainfracloud.org/coprs/kdudka/coreutils-usleep/

David, could you please have a look?

Comment 11 David Kaspar // Dee'Kej 2017-05-19 15:33:37 UTC
(In reply to Kamil Dudka from comment #10)
> Per suggestion in comment #1, I have prepared the coreutils-usleep
> subpakcage for review:
> 
> https://src.fedoraproject.org/cgit/rpms/coreutils.git/commit/?id=751b223b

I have looked at it, tested it, and works correctly. Thank you for this. :)

Comment 12 Kamil Dudka 2017-05-22 15:24:05 UTC
After discussing it with David and Lukas, we decided to deprecate usleep(1) in the initscript package itself by changing the executable to print deprecation message and/or move it to a subpackage of initscripts that will not be installed by default.

Comment 13 Kamil Dudka 2017-05-22 16:19:40 UTC
Introducing new deprecation warnings by minor update in a stable Fedora release could be disruptive for users.  I propose to implement this in f26+ only.

Comment 14 David Kaspar // Dee'Kej 2017-05-31 10:18:56 UTC
Bodhi update here:
https://bodhi.fedoraproject.org/updates/initscripts-9.72-1.fc26

Comment 15 antofthy 2018-07-13 02:06:48 UTC
Work around for shell scripts...


usleep() {
  # They bloody broke usleep by having it report an error
  # This ugly workaround (using scientific) seems to work...
  sleep ${1}e-06
}


Note You need to log in before you can comment on or make changes to this bug.