You are not logged in.

#1 2009-07-08 20:39:15

jamesbond007
Member
From: Germany
Registered: 2009-06-14
Posts: 148

[solved] hddtemp - problem with permissions

Hi,

I installed hddtemp which can output the current temperature of the installed hard disks. When I use hddtemp as root, everything works fine:

# hddtemp /dev/sda
/dev/sda: SAMSUNG HD103UJ: 32°C

But when I try to do the same as a normal user (which is what I actuallay want), then I run into a problem:

~> hddtemp /dev/sda
/dev/sda: Permission denied

I don't really understand this, because /dev/sda is readable for the group "disk":

~> ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 2009-07-08 00:37 /dev/sda
brw-rw---- 1 root disk 8,  1 2009-07-08 00:37 /dev/sda1
brw-rw---- 1 root disk 8,  2 2009-07-08 00:37 /dev/sda2
brw-rw---- 1 root disk 8,  3 2009-07-08 00:37 /dev/sda3
brw-rw---- 1 root disk 8,  4 2009-07-08 00:37 /dev/sda4
brw-rw---- 1 root disk 8, 16 2009-07-08 00:37 /dev/sdb
brw-rw---- 1 root disk 8, 17 2009-07-08 00:37 /dev/sdb1
brw-rw---- 1 root disk 8, 18 2009-07-08 00:37 /dev/sdb2

And my user belongs (among others) to the group "disk":

~> groups
disk lp wheel video audio optical storage power users vboxusers

Any tips on getting this to work as a normal user?

Thanks in advance & kind regards,
jamesbond007.

Last edited by jamesbond007 (2009-07-08 21:43:07)

Offline

#2 2009-07-08 20:47:13

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: [solved] hddtemp - problem with permissions

1) Edit /etc/rc.conf/hddtemp

PARAMS="-q -l 127.0.0.1"
DRIVES="/dev/sda"

2) Restart hddtemp

3) Install gnu-netcat

4) Run

nc localhost 7634

"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#3 2009-07-08 20:55:57

jamesbond007
Member
From: Germany
Registered: 2009-06-14
Posts: 148

Re: [solved] hddtemp - problem with permissions

Hi arkham,

thank you for your quick answer.

1) I have a config file /etc/conf.d/hddtemp which looks like this:

PARAMS="-q -l 127.0.0.1"
DRIVES="/dev/sda"
DRIVES="/dev/sdb"

4) Access to port 7634 with netcat works as a normal user:

~> nc localhost 7634
|/dev/sdb|SAMSUNG HD103UJ|37|C|

But how can I solve the problem, that calling hddtemp fails as a normal user?

~> hddtemp /dev/sda
/dev/sda: Permission denied

Offline

#4 2009-07-08 20:59:52

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: [solved] hddtemp - problem with permissions

You can't, hddtemp has the local interface to allow normal users to read information about temperatures (mainly because the information about temperatures are read from SMART).
I can't see the difference between the nc ouput and the hddtemp one: why do you want that?

EDIT: Oh I've just seen. Your configuration should be DRIVES="/dev/sda /dev/sdb"

Last edited by arkham (2009-07-08 21:04:41)


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#5 2009-07-08 21:11:18

jamesbond007
Member
From: Germany
Registered: 2009-06-14
Posts: 148

Re: [solved] hddtemp - problem with permissions

Hi again,

it must be possible to use hddtemp as a normal user because that's what I did for several years with my former linux distribution before I switched to arch a few weeks ago.

Why do I want that? --> I use KSensors to display some information about the system (e.gl. fan speeds, cpu temp) in the KDE4 system tray. If hddtemp is configured to work as a normal user, KSensors can also display the temperature of the hdds in the system tray, which I find quite useful (especially in the summer).

Offline

#6 2009-07-08 21:20:57

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: [solved] hddtemp - problem with permissions

Your previous distribution was using the suid bit. If you know how dangerous that is and if you still want to do it, google for "set suid bit" and apply it to /usr/bin/hddtemp.


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#7 2009-07-08 21:42:45

jamesbond007
Member
From: Germany
Registered: 2009-06-14
Posts: 148

Re: [solved] hddtemp - problem with permissions

arkham wrote:

EDIT: Oh I've just seen. Your configuration should be DRIVES="/dev/sda /dev/sdb"

Thanks for this correction!

arkham wrote:

Your previous distribution was using the suid bit.

I see! That's the trick!

Thank you very much, arkham.

Offline

#8 2012-06-08 17:31:23

JohnDVD
Member
Registered: 2011-11-29
Posts: 34

Re: [solved] hddtemp - problem with permissions

I use another solution:
#visudo:
...
%disk ALL=(root) NOPASSWD: /usr/sbin/hddtemp

and then just use "sudo hddtemp" instead.

Offline

#9 2012-06-12 01:24:38

fsckd
Forum Moderator
Registered: 2009-06-15
Posts: 3,549

Re: [solved] hddtemp - problem with permissions

JohnDVD, please don't necro-bump. Thanks.
Closing.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB