Sample Header Ad - 728x90

Run pppd automatically for incoming connections

1 vote
1 answer
1404 views
I have my 1989 Mac SE/30 connecting into my Debian 10 router using PPP over a null modem USB RS232 adapter. When I want to connect I first have to SSH into debian from another machine and run
# pppd nodetach /dev/ttyUSB0 57600 -crtscts
Furthermore, if the Mac disconnects then pppd quits and in order to reconnect I have to do the same all over again. Is is possile to get pppd to listen on ttyUSB0 automatically? And to stay up? (All of the documentation I've found is intended for using PPP as a client for dial-up internet connections, not as a server.) **Update**
mini31 # pwd
/etc/systemd/network
mini31 # ls -l
total 4
-rw-r--r-- 1 root root 187 Jun 14 12:12 pppd-ttyUSB0.service
mini31 # cat pppd-ttyUSB0.service
[Service]
ExecStart=/usr/sbin/pppd nodetach /dev/ttyUSB0 57600 -crtscts
Restart=always
RestartSec=0

[Unit]
Description=pppd on ttyUSB0 for SE/30
After=network.target
Wants=network.target
mini31 # systemctl status pppd-ttyUSB0
Unit pppd-ttyUSB0.service could not be found.
mini31 #
**Update 2** Looks like /etc/systemd/system is the only folder that works. Furthermore, you have to:
# systemctl daemon-reload
mini31 # systemctl status pppd-ttyUSB0
● pppd-ttyUSB0.service - pppd on ttyUSB0 for Macs
   Loaded: loaded (/etc/systemd/system/pppd-ttyUSB0.service; static; vendor preset: enabled)
   Active: inactive (dead)
mini31 # systemctl enable pppd-ttyUSB0
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.

Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.
mini31 # systemctl start pppd-ttyUSB0
(Don't know what all that nonsense from enable is about.)
Asked by Richard Barraclough (550 rep)
Jun 14, 2021, 07:55 AM
Last activity: Jun 14, 2021, 11:39 AM