On Wed, Jun 29, 2022 at 12:58:18PM +0200, Andy Shevchenko wrote: > On Wed, Jun 29, 2022 at 12:48 PM Kent Gibson <warthog618@xxxxxxxxx> wrote: > > On Wed, Jun 29, 2022 at 12:27:13PM +0200, Andy Shevchenko wrote: > > > On Wed, Jun 29, 2022 at 11:27 AM Jiří Prchal <jiri.prchal@xxxxxxxxxxx> wrote: > > ... > > > > Do not use shell. Use proper programming language that may give you an > > > easier way of handling this, i.e. _context_. Shell tools are > > > _context-less_ and here is the problem you are trying to solve, but > > > from the wrong end. > > > > Actually my proposed gpioset for v2 will support running interactively > > so it can maintain context and be driven from shell - for cases where > > basic scripting will suffice. > > Dunno if it's the right direction and if I missed any (additional) discussion. > As far as I remember the idea was to introduce DBus aware daemon that > should handle the context of the line and at the same time consider security > implications. Allowing shell to be context-aware is a hidden mine > field. What will happen if the script/user forgets to move the line to > the proper state and the chip will drain a lot of current? So, at > least PM concerns just popped up immediately to my mind. What else can > be problematic? So, I dunno, it's a good idea to allow shell to leave > a line in some state when the user actually doesn't care about it > anymore. At the bare minimum this mustn't be default behaviour. > I don't think it is what you think it is. Take a look. If you don't like it then get Bart to bin it. There was no on-list discussion. I had preliminary disussions with Bart, and had intended to float it as an RFC, but got distracted by other things and ended up going direct to an implementation. Last I heard the DBus daemon is still on the cards, but not sure where Bart is with it, and the gpioset addition is for simpler cases where DBus is overkill or where there is no daemon. It is not the default behaviour, it is an optional mode. gpioset maintains the context, not shell. "User's forgetting" is language independent. Shell scripts matter! What else have I missed replying to? I don't know. And good to see our apparent agreement in the previous mails was just an aberation. I was starting to think there was something wrong with the universe :-|. Cheers, Kent.