들어오는 연결에 대해 자동으로 pppd 실행

들어오는 연결에 대해 자동으로 pppd 실행

내 1989 Mac SE/30은 널 모뎀 USB RS232 어댑터를 통해 PPP를 사용하여 Debian 10 라우터에 연결되어 있습니다.

연결하고 싶을 때 먼저 다른 컴퓨터에서 데비안으로 SSH를 연결하고 다음을 실행해야 합니다.

# pppd nodetach /dev/ttyUSB0 57600 -crtscts

또한 Mac 연결이 끊어졌다가 pppd종료된 경우 다시 연결하려면 동일한 작업을 다시 수행해야 합니다.

자동으로 pppd들을 수 있나요 ttyUSB0? 그리고 늦게까지 깨어있나요?

(내가 찾은 모든 문서는 PPP를 서버가 아닌 전화 접속 인터넷 연결의 클라이언트로 사용하기 위한 것입니다.)

고쳐 쓰다

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 #

업데이트 2

/etc/systemd/system유일한 유효한 폴더인 것 같습니다 .

또한 다음을 수행해야 합니다.

# 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

enable( 이 말도 안되는 소리가 무엇인지 모르겠습니다 .)

답변1

만들다제공하다이 데몬을 실행하세요. systemd 서비스에서는 이 Restart=옵션을 사용하여 종료 시 서비스를 자동으로 다시 시작할 수 있습니다.

[Service]
ExecStart=-/usr/bin/pppd nodetach /dev/ttyUSB0 57600 -crtscts
Restart=always
RestartSec=0

귀하의 상황은 실제로 매우 유사합니다 [email protected]. getty 대신 pppd를 사용하면 일반적으로 지정된 tty에서 로그인 프롬프트를 기다립니다. 따라서 영감을 얻기 위해 단위를 살펴보는 것이 유용할 수 있습니다. 예를 들어 이를 템플릿 단위로 만들고(이름을 지정 pppd@하고 장치 경로로 사용 ) [Unit] 섹션에 /dev/%i포함할 수 있습니다. Conflicts=getty@%i.service; 등.

(실제로 "sysvinit" 환경에서는 pppd에 대한 /etc/inittab 항목을 생성하여 getty와 같은 init에 의해 자동으로 다시 시작되도록 하는 것이 좋습니다.)

관련 정보