From: jr4412 on
On 11 Jan, 00:56, Jim Diamond <Jim.Diam...(a)nospam.AcadiaU.ca> wrote:
> On 2010-01-10 at 06:21 AST, jr4412 <jr4...(a)googlemail.com> wrote:
>
>
>
> > On 9 Jan, 18:54, Jim Diamond <Jim.Diam...(a)nospam.AcadiaU.ca> wrote:
> >> On 2010-01-08 at 16:43 AST, Bud <B...(a)bud.invalid> wrote:
>
> >>> You have to be root to use the command i.e. username]$lsusb
>
> >> Of course, this is not true.  You should really try out such simple
> >> things before spreading misinformation to the rest of the world.
>
> >> To use lsusb as a non-root user, you can
> >> (1) put /sbin in your PATH, or
> >> (2) call it with the explicit pathname
> >>         /sbin/lsusb
> >>     or
> >> (3) cd to /sbin
> >>         cd /sbin
> >>     and then call it as ./lsusb
> >>         ./sbin
> >>     or
> >> (4...) any number of other ways.
>
> >> Cheers.
> >>                                 Jim
> > Jim, are you sure? on Slackware 12.0 executing '/sbin/lsusb' (or by
> > what other method you fancy yields no output and an error return of 1
> > (ie. echo $?).
>
> Well, I don't have a Slackware 12.0 system lying around any more, but
> according to
>  slackware.mirrors.tds.net:/pub/slackware/slackware-12.0/slackware/MANIFEST.bz2
> package a/usbutils-0.72-i486-2.tgz contains /sbin/lsusb
>
> So if you don't have that package installed, Bad Things would happen.
>
> Mind you, if you are getting a status return of -1, as opposed to the
> shell whining "Command not found", then I'd look in the man page and
> see what it says.  The Slack64 13.0 man page says
>   If the specified device is not found, a non-zero exit code is returned.
>
> If you are calling /sbin/lsusb with no command-line args, that man
> page line is a bit vague.
>
> Hmmm... do you have something like
>    none            /proc/bus/usb   usbfs   devgid=83,devmode=664           0 0
> in your /etc/fstab?  If not, while the lsusb man page talks about
> /dev/bus/usb, perhaps without that line in /etc/fstab you don't get
> any files in /dev/bus/usb as well as not getting any entries in
> /proc/bus/usb.
>
> Hmmm... maybe not, I tried unmounting that and lsusb still worked.
> (If you don't have that mounted and want to try it without editing
> fstab and rebooting, run the command
>     mount /proc/bus/usb /proc/bus/usb -t usbfs -o rw,devgid=83,devmode=664
> as root.)
>
> Ummm... by any chance are you using really, really old hardware with
> no USB hubs?
>
> What output do you get if you say
>         ls -l /dev/bus/sub
> (This works for me as an ordinary user, but you might want to try it
> as root on your system.)
>
> I'd be interested in knowing what happens on your system.
>
> Cheers.
>                                 Jim

hi Jim,

thanks for taking an interest. since I've root access on my box,
there aren't any problems and my fstab is written to allow ordinary
users to mount usb (memory) devices; I simply wanted to point out that
under 12.0 the 'lsusb' appears to require root privilege.
now, the h/ware is reasonably recent and fully recognised but I
haven't an entry for usbfs in fstab, perhaps that explains the
difference (might play with this to find out more). thanks again.
From: Grant on
On Sun, 10 Jan 2010 21:06:23 -0400, Jim Diamond <Jim.Diamond(a)nospam.AcadiaU.ca> wrote:

>On 2010-01-10 at 03:32 AST, Bud <Bud(a)bud.invalid> wrote:
>> On 2010-01-09, Jim Diamond wrote:
>> I writ:
>>>> You have to be root to use the command i.e. username]$lsusb
>
>>> Of course, this is not true. You should really try out such simple
>>> things before spreading misinformation to the rest of the world.
>
>> Certainly, other ways but if you are new to Linux, you will have to
>> explain that it can't get a result from just a user and using only
>> lsusb. Simple to just change to root and back again.
>Is that simpler than preceding "lsusb" with "/sbin/" ? Hmmmm.
>
>> Perhaps I should have said as a user use /usr/sbin/lsusb and the
>> result will follow.
>**sigh**
>/usr/sbin/lsusb will work on some Linux distributions, but not on
>Slackware 12.2 or 13.0.

So why get hung up on a path?

root(a)pooh64:~# cat /etc/slackware-version
Slackware 13.0.0.0.0
root(a)pooh64:~# which lsusb
/sbin/lsusb

grant(a)pooh64:~$ /sbin/lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 0d62:a100 Darfon Electronics Corp. Benq Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Grant.
--
http://bugs.id.au
From: Grant on
On Sun, 10 Jan 2010 17:33:44 -0800 (PST), jr4412 <jr4412(a)googlemail.com> wrote:

....
>under 12.0 the 'lsusb' appears to require root privilege.
>now, the h/ware is reasonably recent and fully recognised but I
>haven't an entry for usbfs in fstab, perhaps that explains the
>difference (might play with this to find out more). thanks again.

I don't have slack-12 installed anywhere, but on slack-11.0:

grant(a)deltree:~$ /sbin/lsusb
Bus 001 Device 001: ID 1d6b:0001

AFAIK with slackware (since 2004 I been using it), lsusb, lspci
and friends are in /sbin?

Grant.
--
http://bugs.id.au
From: Bud on
On 2010-01-11, Jim Diamond wrote:
>Bud writ:
>> Perhaps I should have said as a user use /usr/sbin/lsusb and the
>> result will follow.

> /usr/sbin/lsusb will work on some Linux distributions, but not on
> Slackware 12.2 or 13.0.
>
> Jim

Sorry, I was and am now posting from Mandriva 1010, and I checked where it
is in Mandriva, so my apolgies.
From: Henrik Carlqvist on
Grant <g_r_a_n_t_(a)bugsplatter.id.au> wrote:
> I don't have slack-12 installed anywhere, but on slack-11.0:
>
> grant(a)deltree:~$ /sbin/lsusb
> Bus 001 Device 001: ID 1d6b:0001

henca(a)mugin:~> cat /etc/slackware-version
Slackware 12.0.0
henca(a)mugin:~> /sbin/lsusb
henca(a)mugin:~> echo $?
1
henca(a)mugin:~> su
Password:
bash-3.1# /sbin/lsusb
Bus 1 Device 1: ID 0000:0000
bash-3.1# echo $?
0
bash-3.1#

On the above system I do not have any usbfs in fstab. An strace on lsusb
as a normal user shows:

open("/dev/bus/usb/1/1", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/1/1", O_RDONLY) = -1 EACCES (Permission denied)

So on this system a normal user is able to execute /sbin/lsusb when the
entire path is given, but a normal user lacks priveleges to check the
hardware. As allways YMMV depending on your version of Slackware and
different configurations.

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root(a)localhost postmaster(a)localhost