On Mon, Jan 13, 2014 at 09:33:21PM -0300, Fernando de Oliveira wrote: > > Some experimenting I have doen, in the following. > > For a process run by unprivileged user, no complaints, eg, lsof -c vim. > > But for a process run by root, I need to run it as root, because as > unprivileged user, it does complain, as you say: > > {{{ > fernando [ ~ ]$ lsof -c init > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME > init 1 root cwd unknown /proc/1/cwd > (readlink: Permission denied)
First, ignore this reply if I'm becoming overly pedantic, or overly paranoid, or otherwise unuseful (too much aggravation trying to find important paperwork, and then replying to a thread elsewhere by people who are well-intentioned but don't have the item being discussed :) Second - consider a system with multiple (physical) users. Yeah, uncommon for LFS, but supposedly the normal situation for a 'nix system. You would not want ordinary users to be able to access root's processes. > However, when I searched in the internet, the examples all seemed to be > given as root. > > It does not bother me, having to switch to root for some processes, but > it wouldn't bother if I had always to use it as root. > I think that usage of lsof by a normal user is uncommon (which is why the examples you found were all run as root - I assume the main use is "why can't I unmount this?" or "what is preventing a normal shutdown?"), but I've no objection to regular users being able to use it if it is useful to them. ĸen -- das eine Mal als Tragödie, dieses Mal als Farce -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page