The officially official Devuan Forum!

You are not logged in.

#1 2018-05-20 19:52:51

figdev
Member
Registered: 2018-05-14
Posts: 68  

a simpler way for minor distros to make certain actions doable nonroot

theres probably always a better way to do this-- the freedesktop way is to take all the ways available, invent an ever "better one," deprecate the others, and then make the new way depend on whatever they want to saddle the user with.

but that doesnt mean there arent truly better, even traditional ways to do this-- i think of steve litt and udevil and how mounting volumes works in spacefm though not pcmanfm (i used to use pcmanfm for that. in debian 7, when it worked.)

specifically with regards to shutdown and suspend, you probably dont want any user to be able to do that except the one using the desktop, and the root user.

but if you had a simple daemon running as root, it could look for a flag to be created in a user writeable folder-- like /home/user/.powerdaemon for example, and if a file called reboot was created via a username included in a file like /etc/powerdaemon/allowedusers:

/usr/bin/ureboot 
#!/bin/sh
touch /home/$USER/.powerdaemon/reboot

and the name "user" was also a line in /etc/powerdaemon/allowedusers

then /sbin/powerdaemon (the daemon itself) would call /sbin/reboot and no amount of policykit or freedesktop or debian or gnome would be able to do a thing about it.

since this is probably not the most professional method (i would ask what it is, since every "professional" tool keeps getting deliberately broken by its maintainers these days...) i would NOT recommend this for devuan so much as possibly for derivatives.

i would ask "why not just use sudoers?" but since that is never suggested as a response to any questions like this, i just assume that sudoers isnt the thing we want here.

once again: if theres a better way to do this "diy" im just as curious what that would be.

Offline

#2 2018-05-21 12:04:21

Panopticon
Member
Registered: 2018-01-27
Posts: 106  

Re: a simpler way for minor distros to make certain actions doable nonroot

isnt this basically an edit to sudoers? Ive edited sudoers to allow my user access to /sbin/reboot and /sbin/poweroff. Pretty simple process and from what i gather a safe bet? I dont understand the daemon side of this, perhaps meant for a broader user base than single user?

Offline

#3 2018-05-21 16:09:03

figdev
Member
Registered: 2018-05-14
Posts: 68  

Re: a simpler way for minor distros to make certain actions doable nonroot

its possible that a sudoers edit could make it possible to have a simple run dialog that replaced gksu. this post is mostly me being sort of incredulous that replacing gksu is such a challenge.

again, i think i could make a somewhat usable gksu replacement-- im far less certain that i could make a good one, id have to leave that to people that know what theyre doing. someone recommended kdesu to me, fine if you already have kde installed but im guessing that pulls in a lot of kde stuff if you dont.

gksu is the sort of thing where i dont personally need it at all, but i think we can agree that having something "like gksu" is probably something we want to be able to include.

steve litt is pretty good at coming up with "the easy way" to do this stuff, if he spent a couple hours on this im sure that would give the community a nice simple option while gksu is forked or replaced or overhauled. this is not a request or even a lament-- its commentary.

i was sort of hoping someone would say "thats not how you do it-- first, you invert a library protocol, open a reverse socket and fork the process through a wrapper function." at that point i would nod and say "oh, alright" but at least id know i was way off! i thought of sudoers too.

Last edited by figdev (2018-05-21 16:13:38)

Offline

#4 2018-05-22 08:10:38

Panopticon
Member
Registered: 2018-01-27
Posts: 106  

Re: a simpler way for minor distros to make certain actions doable nonroot

What about this yad example that uses empty

graphical front end for su (scroll down for example) : https://sourceforge.net/p/yad-dialog/wiki/Examples/

empty: http://empty.sourceforge.net/

Offline

#5 2018-05-22 13:04:10

figdev
Member
Registered: 2018-05-14
Posts: 68  

Re: a simpler way for minor distros to make certain actions doable nonroot

looks awesome. again, im already sorted personally but how well would this suit most of us?

im still looking for something that might suit our smaller derivatives better than what i could come up with-- even if devuan waits for a more perfect solution, which i dont blame them for and which of course would find its way to our derivatives eventually.

its not that im looking for everyone to standardise either-- its more about finding a solution in a class that would suit more than just me. for my distro, all you have to do instead of gksu is put an icon on the desktop. but thats not going to make everyone happy.

im a fan of yad by the way, i use it as a graphical/gui version of less.

/bin/echo -e '#!/bin/bash\nyad --text-info --editable --wrap  --fontname=monospace --show-uri --maximized --listen' > /usr/bin/yadless 

Offline

Board footer