[HECnet] PyDECnet setup

David Moylan djm at wiz.net.au
Fri Nov 19 05:52:16 PST 2021


Instead of screen, consider using tmux. Once I found out about tmux many years ago, I couldn't believe I hadn't been using it.

One major advantage - you can connect to the same tmux session from multiple sessions, so you don't have disconnect first to reconnect from somewhere else.
It also has handling for mouse and copy/paste, so you can break a tmux window into several panes and scroll with a mouse in each.

You can also have named sessions and connect to them by name.

I use this with simh so I create a shell script for each machine I run up. They automatically connect to a tmux session called "CONSOLE"

Example - here is a script called "start-thomas" which starts up one of my simh vax machines:

--
#!/bin/bash

cd /root/down/vax/THOMAS

tmux has-session -t CONSOLE 2> /dev/null \
  && tmux new-window -d -t CONSOLE -n THOMAS '../BIN/vax' \
  || tmux new -d -s CONSOLE -n THOMAS '../BIN/vax'
--

So basically what this does is check to see if there is already a tmux session called "CONSOLE".
If there is, it creates a new window in this session, otherwise it creates the session from scratch

I have a file like this for each machine, so I can just fire them up non-interactively from the command line.

I then have another script called "console" which has:

--
#!/bin/bash

tmux a -t CONSOLE
--

which just connects to the tmux session called "CONSOLE".

I find this really nice - I have a whole series of windows in a single tmux session which I can easily cycle through.
It's far superior to screen and more flexible.

You could also do the same thing with pyDECnet.

It's very easy to have these fire up in a startup script or systemd etc.

Cheers, Wiz!!


> -----Original Message-----
> From: owner-hecnet at Update.UU.SE <owner-hecnet at Update.UU.SE> On
> Behalf Of Keith Halewood
> Sent: Thursday, 18 November 2021 10:23 AM
> To: hecnet at update.uu.se
> Subject: Re: [HECnet] PyDECnet setup
> 
> I use screen -c file spec to fire off what I need and then detach, from rc.local
> with a sudo to get the user I want. I can then attach/detach from an
> interactive session whenever I want.
> 
> > On 17 Nov 2021, at 23:02, Robert Armstrong <bob at jfcl.com> wrote:
> >
> > 
> >>
> >> Paul Koning <paulkoning at comcast.net> wrote:
> >> If your PyDECnet is run from Unix startup machinery, typically having
> >> it exit would get it restarted shortly after.
> >
> >  Yeah, Upstart will do this if you want to run pyDECnet as a service.
> > I often find that annoying and I don't actually do that for pyDECnet.
> > I have my own script for running pyDECnet instead.  If it exits, it
> > won't come back
> > :)
> >
> > Bob
> >
> >



More information about the Hecnet-list mailing list