Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can I run hdparm as a user? [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 638
Location: UK

PostPosted: Sat Apr 14, 2007 11:21 pm    Post subject: How can I run hdparm as a user? [Solved] Reply with quote

I bought a new Hitachi SATA disk drive, and the code:

Code:
# hdparm -H /dev/sda


returns the drive's current temperature. I'd like to incorporate this into my Superkaramba system monitoring widget, but when run as a user I get "permission denied".

So how could I access this result as a user? Could I add the user to the disk group for example, and if I did are there any security implications (such as the user being able to format the disk)?
_________________
Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson


Last edited by tabanus on Mon Apr 16, 2007 8:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
Pseudonimo
Guru
Guru


Joined: 10 Mar 2007
Posts: 393

PostPosted: Sat Apr 14, 2007 11:25 pm    Post subject: Reply with quote

I don't use sudo, but I remember seeing there some rules which maybe could allow stuff like that (wo/passwd). See /etc/sudoers or something, not sure
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sat Apr 14, 2007 11:42 pm    Post subject: Reply with quote

perhaps by giving it a suid bit?

chmod +s

but I think that could be a security issue / problem ...

any other opinion appreciated ...
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 638
Location: UK

PostPosted: Sun Apr 15, 2007 1:09 am    Post subject: Reply with quote

kernelOfTruth wrote:
perhaps by giving it a suid bit?

chmod +s

but I think that could be a security issue / problem ...

any other opinion appreciated ...


I think that's a better solution than mine. At least then if I got hacked the worst they could do is mess up disk optimisations.
_________________
Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson
Back to top
View user's profile Send private message
llavalle
n00b
n00b


Joined: 28 Nov 2004
Posts: 38
Location: Montréal, Quebec, Canada

PostPosted: Mon Apr 16, 2007 2:03 am    Post subject: Reply with quote

Take a look at hddtemp
http://gentoo-portage.com/app-admin/hddtemp
It can be run as a daemon and most monitoring apps can read it.
_________________
Dual P2-450 Server running from a Stage1
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Mon Apr 16, 2007 2:08 am    Post subject: Reply with quote

llavalle wrote:
Take a look at hddtemp
http://gentoo-portage.com/app-admin/hddtemp
It can be run as a daemon and most monitoring apps can read it.


++

hdparm is potentially dangerous, use hddtemp. A silly bug in any karamba script could be a very unpleasant experience.
Back to top
View user's profile Send private message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 638
Location: UK

PostPosted: Mon Apr 16, 2007 8:34 pm    Post subject: Reply with quote

llavalle wrote:
Take a look at hddtemp
http://gentoo-portage.com/app-admin/hddtemp
It can be run as a daemon and most monitoring apps can read it.


Excellent. That looks just the job. Which monitoring apps would you suggest? The man page suggests netcat or telnet. What else is there?
_________________
Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9882
Location: almost Mile High in the USA

PostPosted: Mon Apr 16, 2007 8:48 pm    Post subject: Reply with quote

Don't chmod +s hdparm unless you trust your users to not do some cheesy denial of service like

Code:
hdparm -d 0 -r 1
while true; do
hdparm -tTY /dev/hda1 &
done


!!! byebye computer :-( ....
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Mon Apr 16, 2007 8:49 pm    Post subject: Reply with quote

tabanus wrote:
llavalle wrote:
Take a look at hddtemp
http://gentoo-portage.com/app-admin/hddtemp
It can be run as a daemon and most monitoring apps can read it.


Excellent. That looks just the job. Which monitoring apps would you suggest? The man page suggests netcat or telnet. What else is there?


I know gkrellm and conky can read hddtemp's output. Conky needs to enable the hddtemp use flag for this to work.
Back to top
View user's profile Send private message
llavalle
n00b
n00b


Joined: 28 Nov 2004
Posts: 38
Location: Montréal, Quebec, Canada

PostPosted: Mon Apr 16, 2007 9:54 pm    Post subject: Reply with quote

The Gnome Hardware monitor supports it too. You also need the use flag.
_________________
Dual P2-450 Server running from a Stage1
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum