You are not logged in.
Pages: 1
Hello!
Is there anyway of getting hddtemp to work without having to key in the password? I have tried adding
shylock ALL = NOPASSWD: /usr/sbin/hddtemp
Also tried:
%hwmon ALL = NOPASSWD: /usr/sbin/hddtemp
What I'm trying to do is making an alias like I did with gpu temp
alias gpu?='nvclock -i | grep temp'
For Hddtemp as well. Now my only option left is to echo my password and feed it to sudo, which is not a good idea I think. Any help?
Last edited by sHyLoCk (2009-06-28 02:50:47)
Offline
%<group> ALL = NOPASSWD: /usr/sbin/hddtemp
or you can do
<yourusername> ALL = NOPASSWD: /usr/sbin/hddtemp
but than you need to run hddtemp with sudo infront of it
I don't think it's smart to give a normal user access to /dev/sda
Edit: remember to use visudo!
Last edited by jordz (2009-06-27 17:53:07)
Offline
Eww, this looks ugly.
Another approach is to add hddtemp to your daemons array in /etc/rc.conf and modify /etc/conf.d/hddtemp. Mine looks like:
PARAMS="-q -l 127.0.0.1"
DRIVES="/dev/sda"
Start the daemon as root "/etc/rc.d/hddtemp start", and as normal user run "nc localhost 7634"
Last edited by arkham (2009-06-28 02:17:02)
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
%<group> ALL = NOPASSWD: /usr/sbin/hddtemp
or you can do
<yourusername> ALL = NOPASSWD: /usr/sbin/hddtemp
but than you need to run hddtemp with sudo infront of it
I don't think it's smart to give a normal user access to /dev/sdaEdit: remember to use visudo!
Thnx 4ur reply.Hmm I already said I tried that, still asking for password. Temporarily I'm using echo to solve this issue, which is a horrible solution! I need a better one.
Eww, this looks ugly.
Another approach is to add hddtemp to your daemons array in /etc/rc.conf and modify /etc/conf.d/hddtemp. Mine looks like:
PARAMS="-q -l 127.0.0.1" DRIVES="/dev/sda
Start the daemon as root "/etc/rc.d/hddtemp start", and as normal user run "nc localhost 7634"
Yes I did that already. Still says Permission denied without sudo.
Last edited by sHyLoCk (2009-06-27 18:07:18)
Offline
You won't need to start the daemon manually if you put it in the daemons array.
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
something worth noting, you have to log in/out again for groups and sudoers changes to take affect. the nc method is better and "works for me" but the visudo method shouldn't ask for a password once you log in/out, if you've typed the line correctly.
//github/
Offline
As root
chown +s /usr/sbin/hddtemp
Then as user
hddtemp
and it will work :-) No crappy sudo required. The "downside" is, that with this version EVERY user on your computer can run the command hddtemp and will get a result. You have the choice
Offline
As root
chown +s /usr/sbin/hddtemp
Adding the suid bit to an executable is always kindof risky though..
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
Post deleted.
Last edited by DevoidOfWindows (2009-06-28 20:00:09)
Offline
I don't think the problem is with /usr/sbin/hddtemp
I'm getting: /dev/sda: open: Permission denied
So, /dev/sda is the problem which is denying access to hddtemp in normal user mode.
Offline
Follow these steps:
1) Run as root
nano /etc/conf.d/hddtemp
PARAMS="-q -l 127.0.0.1"
DRIVES="/dev/sda"
2) Run as root
/etc/rc.d/hddtemp start
3) Run as root
nano /etc/rc.conf
Add hddtemp to the daemons array
4) Run as normal user
nc localhost 7634
Last edited by arkham (2009-06-28 02:15:10)
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
Mmm, are you sure the hard disk is /dev/sda? What is the output of
mount
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
Thanks for all your replies. Ok I managed to start it ith another reboot after reinstalling netcat.
nc localhost 7634 shows me :
|/dev/sda|???|ERR|*
Yes it's /dev/sda, I'm getting temperature by using sudo hddtemp /dev/sda
When I try without sudo it says /dev/sda open: Permission Denied.
Here's mount output:
$ mount
/dev/sda5 on / type ext4 (rw)
none on /dev type ramfs (rw,relatime)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
none on /dev/pts type devpts (rw)
none on /dev/shm type tmpfs (rw)
/dev/sda1 on /windows type fuseblk (rw,allow_other,blksize=4096)
/dev/sda6 on /home type ext4 (rw)
gvfs-fuse-daemon on /home/shylock/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=shylock)
/dev/sdb3 on /media/Videos type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sdb5 on /media/Misc type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sdb4 on /media/zer0 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sdb1 on /media/Music type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
EDIT: Ok I dont know what happened now i cant even use sudo?
$ sudo hddtemp /dev/sda
/dev/sda: Permission denied
Last edited by sHyLoCk (2009-06-28 01:56:00)
Offline
Mmm I just realized I made a mistake; /etc/conf.d/hddtemp should contain
PARAMS="-q -l 127.0.0.1"
DRIVES="/dev/sda"
I forgot the closing double quote in my original posts (now edited )
Restart hddtemp as root
/etc/rc.d/hddtemp restart
Run as user
nc localhost 7634
Hopefully, it should work now; with this solution, you will never have to use the hddtemp command, just run netcat everytime you want to know the temperature.
Last edited by arkham (2009-06-28 02:20:07)
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
Thanks arkham, but my PARAMS field was ok, the problem was that I had "chown" hddtemp to my username and it wasn't letting me access /dev/sda. i changed its ownership back to root and now I can use the command you suggested:
nc localhost 7634
to get the temp.
Last edited by sHyLoCk (2009-06-28 02:53:25)
Offline
Oh I see; anyway, glad it worked
"I'm Winston Wolfe. I solve problems."
~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~
Offline
Pages: 1