You are not logged in.
Hej Forum
I have a whole MythTV under the stairs solution running in my house.
The only thing I'm missing in the end - is the shutdown process.
Caurse of sharing etc - I've made a user called myth which is the user - controlling my MythTV setup.
On the different Frontends I have a buttom called shutdown. But this ain't working. How is the best way to solve this problem?
Since I should be the myth user - I log as myth and calling the script: /usr/bin/mythshutdown:
$ mythshutdown -q
QSettings::sync: filename is null/empty
poweroff: must be superuser.
This returns after giving the command. Is there a way to add the user - so I got the permission to execute this command???
It'll only send the command mythshutdown -q - su needed that myth user have permission for that command?
Thanks
Last edited by peque (2008-01-07 21:57:33)
Just getting better .... All the time
Offline
Configure sudo for your user to allow it to shutdown your computer, and modify /usr/bin/mythshutdown accordingly.
Offline
Well - My fault!
Mythshutdown is a binary file - so don't have the option for editing this one.
About sudo:
Well have really tried with all combinations from WIKI etc - but without any luck.
Still getting the same error! about must be superuser!
So I would hope a little more advice:
This is what I have tried to change i /etc/sudoers
Uncomment this line (since myth are in users)
%users localhost=/sbin/shutdown -h now
Uncomment this line( myth are also in wheel)
%wheel ALL=(ALL) NOPASSWD: SETENV: ALL
and least :
%users localhost=/usr/bin/mythshutdown -q
But none of these works
Just getting better .... All the time
Offline
nihathrael reaper = NOPASSWD: /sbin/shutdown
This is what i use for my shutdown. nihathrael being the username and "reaper" the hostname. If you change that to your desired program to run, it should work.
Unknown Horizons - Open source real-time strategy game with the comfy Anno 1602 feeling!
Offline
If /usr/bin/mythshutdown is a binary file that does all the work then you need to set up sudo to allow the myth user (or a group the user is in) to run /usr/bin/mythshutdown as a superuser.
Once sudo is configured, you need to make your shutdown button run "sudo /usr/bin/mythshutdown"
Offline
If /usr/bin/mythshutdown is a binary file that does all the work then you need to set up sudo to allow the myth user (or a group the user is in) to run /usr/bin/mythshutdown as a superuser.
Once sudo is configured, you need to make your shutdown button run "sudo /usr/bin/mythshutdown"
gpasswd -a user power
that should give them proper permissions.
and for shutting down a computer I like the 'halt' command. It cleanly shuts down all processes first.
Last edited by theringmaster (2008-01-07 14:24:58)
Check me out on twitter!!! twitter.com/The_Ringmaster
Offline
I think the power group is only of relevance for DBUS/HAL-assisted solutions, not for normal poweroff/halt/shutdown.
1000
Offline
1) When you uncomment the wheel line in sudoers.. make sure you add your myth user to the wheel group!
2) Even if you do this the sudo way.. the command to call shutdown will have to be "sudo shutdown" and I'm not sure your frontend button is calling that command. (I could be wrong though)
Instead of messing with sudo, you could set the SUID permission on the shutdown binary.. I've heard this isn't the safest practice though (just a warning).
chmod u+s /usr/bin/mythshutdown
Last edited by Zer0 (2008-01-07 17:21:47)
Offline
Well - I tried both ways.
Ended up with editing the /etc/sudoers to allow my user to run to one single command - mythshutdown
And in the configuration for Mythtv - put a sudo in front - that does the trick - so thanks.
Just getting better .... All the time
Offline