着信接続に対して自動的にpppdを実行する

着信接続に対して自動的にpppdを実行する

私の1989 Mac SE / 30は、ヌルモデムUSB RS232アダプタを介してPPPを使用してDebian 10ルータに接続されています。

接続したい場合は、まず別のコンピュータからDebianに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によって自動的に再起動されるようにすることをお勧めします。)

おすすめ記事