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

Converting from four command executions to one #14

Closed
dominguesgm opened this issue Jul 16, 2018 · 6 comments · Fixed by #30
Closed

Converting from four command executions to one #14

dominguesgm opened this issue Jul 16, 2018 · 6 comments · Fixed by #30
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted

Comments

@dominguesgm
Copy link
Contributor

dominguesgm commented Jul 16, 2018

Issuehunt badges

To avoid possible inconsistencies in the results which can appear from processes being started/killed while the four ps executions are done, wouldn't it be preferable to get all the data from a single ps and process it all at once?

In fact I think that may be why the build of the pull request #13 is breaking. On of the ps processes is identifying another one of the ps executions. It may have become more frequent in that pull request due to the fact that it implements a fifth ps execution.


IssueHunt Summary

[
<
i
m
g

s
r
c

'
h
t
t
p
s
:
/
/
a
v
a
t
a
r
s
3
.
g
i
t
h
u
b
u
s
e
r
c
o
n
t
e
n
t
.
c
o
m
/
u
/
1
7
6
2
1
4
?
v

4
'

a
l
t

'
s
t
r
o
n
c
i
u
m
'

w
i
d
t
h

2
4

h
e
i
g
h
t

2
4

s
t
r
o
n
c
i
u
m
]
(
h
t
t
p
s
:
/
/
i
s
s
u
e
h
u
n
t
.
i
o
/
u
/
s
t
r
o
n
c
i
u
m
)

h
a
s

b
e
e
n

r
e
w
a
r
d
e
d
.

Backers (Total: $60.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

@sindresorhus
Copy link
Owner

Yes, it would definitely be preferable, but there's a reason I'm doing it like this. See: 74ee7b8

Happy to consider other solutions.

@dominguesgm
Copy link
Contributor Author

I see, now that I've tried it in my console even when I try to get the "comm" parameter alone the output is being truncated, no idea why because I think it shouldn't.

@IssueHuntBot
Copy link

@IssueHunt has funded $60.00 to this issue. See it on IssueHunt

@stroncium
Copy link
Contributor

stroncium commented Mar 17, 2019

It actually should. ps is designed to give out user-friendly description, so it got limits on width of each column. Those can be configured(though I suppose some older versions of ps might ignore this configuration, but due to a combination of various limits inside ps source code there is no possible configuration which would result in guaranteed printing of all the data for every possible process.

One way to go about it is to just ditch ps and read the data directly in linux-like OSes, but in OS X there is no proc, so it requires using syscalls which isn't possible without binary modules as far as I know.

@stroncium
Copy link
Contributor

stroncium commented Mar 17, 2019

#30 is not expected to always work(but so is ps, and ps-list usage of ps), but should work in every case ps-list worked before and more, on all common setups.
(Though looking at ps source codes it's fairly easy to modify linux kernel to break ps, also some modern kernels allow thing which should break ps with properly crafted processes alone. Plus, current buffer allows for only 10MiB of data per ps run, while modern distros allow up to 2MiB of data per process, and most ps versions I checked allow more than 100KiB per process.)

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Jun 20, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Jun 20, 2019

@sindresorhus has rewarded $54.00 to @stroncium. See it on IssueHunt

  • 💰 Total deposit: $60.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $6.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants