Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uptime/htop don't actually work #819

Closed
ttrash opened this issue Aug 27, 2018 · 8 comments
Closed

uptime/htop don't actually work #819

ttrash opened this issue Aug 27, 2018 · 8 comments

Comments

@ttrash
Copy link

ttrash commented Aug 27, 2018

uptime 09:31:48 up 0 min, 0 users, load average: 0.00, 0.00, 0.00

hour is right, uptime is not, load is not, this one was in termux

in terminal emulator, same command (which is executed from /system/bin/uptime) I get all the relevant information (how much uptime, and the 3 numbers of system load)

also, this is a library problem, not this command explicitly problem be cause, htop behave the same, I have 0.00 all 3 load numbers and no processor load to show in left top corner (graphic show)

my phone is S8+ ... NOT ROOTED WHATSOEVER ...

and again, just to be sure
in terminal emulator this is working, with no problems, in the very same time with termux, therefore is not my system/phone to blame

please fix, thank you !

@ghost
Copy link

ghost commented Aug 27, 2018

@ttrash Since access to files /proc/uptime, /proc/loadavg, /proc/stat is restricted by SELinux, regular program can't read these files (root needed).

However there is an exception for /system/bin/uptime and busybox uptime: these tools use a system call instead of reading mentioned files to obtain needed system information.

And just for note: all programs in /system/bin and /system/xbin have necessary SELinux labels so they may have extended rights for accessing files under /proc. Try command busybox top and /system/bin/top and you will see the difference.

also, this is a library problem

Where you got this information ? Which library ?

therefore is not my system/phone to blame

Unfortunately, you have to blame SELinux...

please fix, thank you !

We cannot fix SELinux since this is a system feature.

@ttrash
Copy link
Author

ttrash commented Aug 27, 2018

nice, I don't want to ask you about busybox, both apps from store require root, or do absolutely nothing
I would like to have this feature anyway, therefore:

help me with this workaround:
/system/bin/uptime
CANNOT LINK EXECUTABLE "/system/bin/uptime": cannot locate symbol "OpenSSL_add_all_algorithms" referenced by "/system/lib64/libselinux.so"...
Aborted

@Grimler91
Copy link
Member

@ttrash termux provides busybox, you don't need to get another app from play store.

$ which busybox
/data/data/com.termux/files/usr/bin/busybox

@ghost
Copy link

ghost commented Aug 27, 2018

@ttrash This linking error is Samsung-specific (same on my Samsung Galaxy S7, but not on other devices), so you have to do this:

LD_LIBRARY_PATH= /system/bin/uptime
 12:44:16 up 10 days, 21:31,  0 users,  load average: 5.66, 5.70, 5.92

For me, just uptime works as well:

$ uptime
 12:45:43 up 10 days, 21:32,  load average: 5.72, 5.69, 5.89

@ttrash
Copy link
Author

ttrash commented Aug 27, 2018

LIBRARY_PATH= /system/bin/uptime
CANNOT LINK EXECUTABLE "/system/bin/uptime": cannot locate symbol "OpenSSL_add_all_algorithms" referenced by "/system/lib64/libselinux.so"...

@ghost
Copy link

ghost commented Aug 27, 2018

@ttrash Sorry, my mistake =). Just copied/pasted only part of text.

It should be LD_LIBRARY_PATH= /system/bin/uptime.

@fornwall
Copy link
Member

@ttrash Thanks for reporting!

uptime has now been removed from the latest 3.3.15-1version of the procps package, so Termux users should always get the working uptime from busybox in the PATH.

fornwall added a commit to termux/termux-packages that referenced this issue Aug 27, 2018
The uptime program from procps does not work on later android versions
where reading /proc/uptime is not allowed.

See termux/termux-app#819
@ttrash
Copy link
Author

ttrash commented Aug 28, 2018

thank you, now both are working:
busybox uptime
and
LD_LIBRARY_PATH= /system/bin/uptime

I don't really like workarounds, but is better than nothing, again

Thank You ! :)

LE wow, you move fast, I see after update that now uptime is a link to busybox, therefore it is working too, good job !

@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants