On Fri 17 Jun 2022 at 18:14:41 (-0400), gene heskett wrote:
> On 6/17/22 16:29, Anssi Saari wrote:
> > gene heskett <ghesk...@shentel.net> writes:
> > 
> > > I just did all that, so now I have an /etc/rc.local but not an rc-local
> > > but he changes from rc.local to rc-local in the middle. confusing.
> > > 
> > > So which is it. I originally created an rc.local, changed it to
> > > rc-local, and back with mv.

> > The script file is /etc/rc.local but the systemd service name is
> > rc-local.
> > 
> > > Now, I'm not aware of who heyu runs as, probably gene since I'm the
> > > one running it and there is no user heyu.
> > > 
> > > Now, 2 new questions:
> > > 
> > > So what do I put in this rc.local to allow me, gene, to use /dev/ttyUSB0,
> > > which has the cm11a on the other side of an fdti adaptor?

> > Since you seem to have the expected permissions for /dev/ttyUSB0 and
> > /dev/ttyUSB1 maybe you could just add gene and nut users to the dialout
> > group? adduser gene dialout and adduser nut dialout.
> > 
> > But if you really want to use rc.local then setting the group to nut
> > for the UPS line /dev/ttyUSB1 would work, so just
> > 
> > chgrp nut /dev/ttyUSB1
> > 
> > And then chgrp gene /dev/ttyUSB0
> > 
> > Hope it helps!

> Absolutely the magic twanger Anssi. I put it all in rc.local, or in
> /etc/group
> then ran rc.local for S&G, checked the devices were changed, restarted
> nut-server and nut-client, works as expected, then ran "heyu info" as me
> and got the expected response.
> 
> Finally, someone was not afraid to answer my questions.

I missed seeing the answer to your first question, at the beginning of
the month, where you asked how to determine which way round the ttyUSBs
have been assigned at boot.¹ I've only seen your reports of unplugging
and replugging the connections each time. I'm afraid that's the question
I was interested in answering by means of the example I gave.

Until you know which is which, you can't reliably assign the port to
TTY in nut (which should set the ownerships itself, shouldn't it?).
I don't know about those for heyu as it's not in Debian at present.

¹ "As a furinstance, I used to be able to cat a /dev/ttyUSB*, which made
   self indentifying which was which easy, cuz if you unplug a cm11a, it
   will send … … …".

Cheers,
David.

Reply via email to