Privilege(s) needed to run top command

classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Privilege(s) needed to run top command

jwang
This is used to work for a ordinary login.

After re-install, top does not show the true load et al.  Nor processes
owned by SYSTEM.

Please shed some light.

Thanks a lot in advance



--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

L A Walsh
On 3/11/2019 9:50 AM, jwang wrote:
> This is used to work for a ordinary login.
>
> After re-install, top does not show the true load et al.  Nor processes
> owned by SYSTEM.
>
> Please shed some light.  Thanks a lot in advance.
>  
You mean this:

top - 13:26:15 up 1 day, 16:13,  1 user,  load average: 4.91, 7.22, 7.72
Tasks:  12 total,   1 running,  11 sleeping,   0 stopped,   0 zombie
%Cpu(s):  15.4/1.3  
17[                                                     ]
GiB Mem : 15.9/95.651  
[                                                     ]
GiB Swap:  0.0/95.651  
[                                                     ]
 
  PID USER      PR  NI    VIRT    RES  %CPU %MEM     TIME+ S
COMMAND          
 2016 SYSTEM     8   0    8.4m   8.2m   0.0  0.0   0:00.03 S
cygrunsrv        
 2017 SYSTEM     8   0    9.8m   9.1m   0.0  0.0   3:09.82 S  `-
cygserver    
 2018 SYSTEM     8   0    8.3m   7.8m   0.0  0.0   0:00.00 S
cygrunsrv        
 2019 SYSTEM     8   0    7.1m   6.9m   0.0  0.0   0:00.09 S  `-
dbus-daemon  
 2023 SYSTEM     8   0    6.9m   6.9m   0.0  0.0   0:00.03 S
syslogd          
 2028 Bliss\l+   8   0    7.6m   7.1m   0.0  0.0   0:00.00 S
inetd            
13134 Bliss\l+   8   0    7.0m   7.1m   0.0  0.0   0:00.06 S  `-
rlogind      
13135 Bliss\l+   8   0    8.8m  10.2m   0.0  0.0   0:00.49 S      `-
bash      
13267 Bliss\l+   8   0   10.2m  10.2m   3.0  0.0   0:02.68 R          `-
top  
 2046 Bliss\l+   8   0  154.6m 137.2m   0.0  0.1  19:23.48 S
XWin              
 2187 Bliss\l+   8   0    7.4m   7.4m   0.0  0.0   0:00.31 S
sshd              
 2514 Bliss\l+   8   0    9.6m  19.6m   0.0  0.0   0:00.40 S gvim
----

Did you mean that it doesn't show non-cygwin processes? or does your 'top'
really not display cygwin's SYSTEM processes?


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

ASSI
In reply to this post by jwang
jwang writes:
> This is used to work for a ordinary login.
>
> After re-install, top does not show the true load et al.  Nor processes
> owned by SYSTEM.
>
> Please shed some light.

Cygwin is a user-space layer.  It can't show you information that the
underlying OS determines to be off-limits for you.


Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Corinna Vinschen-2
On Mar 11 21:41, Achim Gratz wrote:

> jwang writes:
> > This is used to work for a ordinary login.
> >
> > After re-install, top does not show the true load et al.  Nor processes
> > owned by SYSTEM.
> >
> > Please shed some light.
>
> Cygwin is a user-space layer.  It can't show you information that the
> underlying OS determines to be off-limits for you.
And I just checked, even under Cygwin 2.11.2, procps and top were
not showing foreign processes if you're running under a non-admin
user account or a non-elevated shell, so this is nothing new.

In fact, `procps' at least tries to access /proc/<PID>/stat.  This
doesn't return valid information because it has to be able to open a
process with PROCESS_QUERY_LIMITED_INFORMATION and PROCESS_VM_READ
permissions.  No ordinary user has these permissions on processes she
doesn't own.(*)

However, Cygwin's `ps -e' was supposed to show all processes, but
it didn't anymore since I created helper objects in the NT namespace
with insufficient privileges for everyone.  I pushed a patch and
uploaded new developer snapshots to https://cywin.com/snapshots/
for testing.


Thanks,
Corinna

(*) That doesn't mean it's not possible.  In theory all Cygwin
    processes could be opened to allow everyone
    PROCESS_QUERY_LIMITED_INFORMATION access, which would at least
    fill most of /proc/<PID>/stat for foreign processes.
    However, we never did that, so it can't have worked yet.

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

ASSI
Corinna Vinschen writes:
> (*) That doesn't mean it's not possible.  In theory all Cygwin
>     processes could be opened to allow everyone
>     PROCESS_QUERY_LIMITED_INFORMATION access, which would at least
>     fill most of /proc/<PID>/stat for foreign processes.
>     However, we never did that, so it can't have worked yet.

Could we make it work under the condition that cygserver is running?


Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Andrey Repin
Greetings, Achim Gratz!

> Corinna Vinschen writes:
>> (*) That doesn't mean it's not possible.  In theory all Cygwin
>>     processes could be opened to allow everyone
>>     PROCESS_QUERY_LIMITED_INFORMATION access, which would at least
>>     fill most of /proc/<PID>/stat for foreign processes.
>>     However, we never did that, so it can't have worked yet.

> Could we make it work under the condition that cygserver is running?

cygserver is not necessarily running with localsystem privileges, though, if
I'm not mistaken.


--
With best regards,
Andrey Repin
Tuesday, March 12, 2019 3:16:37

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Corinna Vinschen-2
In reply to this post by ASSI
On Mar 11 22:40, Achim Gratz wrote:
> Corinna Vinschen writes:
> > (*) That doesn't mean it's not possible.  In theory all Cygwin
> >     processes could be opened to allow everyone
> >     PROCESS_QUERY_LIMITED_INFORMATION access, which would at least
> >     fill most of /proc/<PID>/stat for foreign processes.
> >     However, we never did that, so it can't have worked yet.
>
> Could we make it work under the condition that cygserver is running?

If this functionality is really necessary, it should ideally work
without having a service running.

Another, easier way out would be to allow /proc/<PID>/stat (and perhaps
others) to succeed even if the process info can't be grabbed due to
permissions.  It wouldn't show really useful info, but procps or top
would at least show the process.


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

jwang
In reply to this post by ASSI
It used to work.
<http://cygwin.1069669.n5.nabble.com/file/t11507/cygwin_top_issue.png>

As can be seen from above screenshot, CPU load is 0! (when login as an
Administrator , it shows about 1)

ps -e (or ps -W) no longer shows processes such as cron and sshd et al owned
by SYSTEM



--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Corinna Vinschen-2
On Mar 12 02:41, jwang wrote:
> It used to work.
> <http://cygwin.1069669.n5.nabble.com/file/t11507/cygwin_top_issue.png>
>
> As can be seen from above screenshot, CPU load is 0! (when login as an
> Administrator , it shows about 1)
>
> ps -e (or ps -W) no longer shows processes such as cron and sshd et al owned
> by SYSTEM

Try the latest snapshot from https://cygwin.com/snapshots/

It re-enables ps output and improves procps and top output.  Note
that not all information in /proc is available since that requires
permissions normal users don't have on foreign processes.


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

jwang
After last weekend update, I believe I had already the latest version
installed:

lc cygwin1.dll|xargs ls -lsa
3412 -rwxr-xr-x 1 admin None 3489952 Mar  5 18:59 /bin/cygwin1.dll
3412 -rwxr-xr-x 1 admin None 3489952 Mar  5 18:59 /usr/bin/cygwin1.dll





--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Houder
On Tue, 12 Mar 2019 04:55:01, jwang  wrote:
> After last weekend update, I believe I had already the latest version
> installed:
>
> lc cygwin1.dll|xargs ls -lsa
> 3412 -rwxr-xr-x 1 admin None 3489952 Mar  5 18:59 /bin/cygwin1.dll
> 3412 -rwxr-xr-x 1 admin None 3489952 Mar  5 18:59 /usr/bin/cygwin1.dll

https://cygwin.com/snapshots/

Henri


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

jwang
I downloaded the latest snapshots and it did not make any difference.
Thanks



--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Corinna Vinschen-2
On Mar 12 08:45, jwang wrote:
> I downloaded the latest snapshots and it did not make any difference.

It certainly does.  I'm testing this myself.  In a session of a
non-privileged user I now see all other Cygwin processes in ps, procps
and top.   I see processes from another RDP session as well as the
processes running under SYSTEM.'

What exactly is missing?


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

jwang
Sir,

I download, this morning:
3132 -rw-r--r--  1 james None 3207004 Mar 12 10:50 cygwin-20190312.tar.xz

tar -xvf cygwin-20190312.tar.xz

then I did:

usr/bin/ps -W|grep httpd

nothing returned from the above command.



--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Corinna Vinschen-2
On Mar 12 10:00, jwang wrote:
> Sir,

Nope.

> I download, this morning:
> 3132 -rw-r--r--  1 james None 3207004 Mar 12 10:50 cygwin-20190312.tar.xz
>
> tar -xvf cygwin-20190312.tar.xz

Where to?  You have to install cygwin1.dll in place of the other
cygwin1.dll while having stopped all Cygwin processes.  Just unpacking
with tar won't do anything useful.

> then I did:
>
> usr/bin/ps -W|grep httpd

This is really not helpful as far as bug reports go.  Drop the
grep, drop the -W.  Just call `ps -e' or `procps -e' or `top'
and see what's visible.  Do you see all CYgwin processes?  If so, fine.
If not, please report details.  Just don't expect top's load average
values to make any sense if you're running under a non-privileged
user account.  They will be always 0.


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

jwang
Understood.  Thanks.

However, top command used to show load average under non-privileged user
(till I upgraded cygwin) and I wish to have that back please if I may.

Thanks a lot for your help



--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Corinna Vinschen-2
In reply to this post by Corinna Vinschen-2
On Mar 12 18:13, Corinna Vinschen wrote:

> On Mar 12 10:00, jwang wrote:
> > Sir,
>
> Nope.
>
> > I download, this morning:
> > 3132 -rw-r--r--  1 james None 3207004 Mar 12 10:50 cygwin-20190312.tar.xz
> >
> > tar -xvf cygwin-20190312.tar.xz
>
> Where to?  You have to install cygwin1.dll in place of the other
> cygwin1.dll while having stopped all Cygwin processes.  Just unpacking
> with tar won't do anything useful.
>
> > then I did:
> >
> > usr/bin/ps -W|grep httpd
>
> This is really not helpful as far as bug reports go.  Drop the
> grep, drop the -W.  Just call `ps -e' or `procps -e' or `top'
> and see what's visible.  Do you see all CYgwin processes?  If so, fine.
> If not, please report details.  Just don't expect top's load average
> values to make any sense if you're running under a non-privileged
> user account.  They will be always 0.
Btw., `ps -W' only shows non-Cygwin processes visible inside the
current user session.  This session isolation has been introduced with
Windows 2003 and since Vista even the console interactive session is
running in its own session distinct from session 0.

Task Manager doesn't suffer this problem, but it's not clear to me why.
Perhaps it connects to a broker service which gives task manager access
to all processes.


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Corinna Vinschen-2
In reply to this post by jwang
On Mar 12 10:13, jwang wrote:
> Understood.  Thanks.
>
> However, top command used to show load average under non-privileged user
> (till I upgraded cygwin) and I wish to have that back please if I may.

Add your user to the "Performance Monitoring Users" group.


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

Houder
In reply to this post by Corinna Vinschen-2
On Tue, 12 Mar 2019 18:13:39, Corinna Vinschen  wrote:

> On Mar 12 10:00, jwang wrote:
> > Sir,
>
> Nope.
>
> > I download, this morning:
> > 3132 -rw-r--r--  1 james None 3207004 Mar 12 10:50 cygwin-20190312.tar.xz

(Sigh)

James, please, please, read this:

https://cygwin.com/faq.html#faq.what.who

The person you are communicating w/ is Corinna V.

Then, read this, please!

https://en.wikipedia.org/wiki/Corinne_(name)

Subsequently, read this part of the FAQ:

https://cygwin.com/faq.html#faq.setup.snapshots

An URL to which is referred at the bottom of

https://cygwin.com/snapshots/

Henri


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Privilege(s) needed to run top command

ASSI
In reply to this post by jwang
jwang writes:
> tar -xvf cygwin-20190312.tar.xz

Well, if that didn't give you an error you now have an unused Cygwin
DLL in whatever directory you extracted the tar in.  How about you
actually read how it's done?

https://cygwin.com/faq.html#faq.setup.snapshots


Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

12