1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

HULFTをsystemdのサービスとして動かすユニットファイルを作った

1
Posted at

ネットでいろいろ調べたけど、なかなか有益な情報がなかったので自分で作成してみた。
最近のLinuxはsystemdを使っているケースが多いが、HULFTにはユニットファイルは付属しておらず、initの起動・停止スクリプトすら付いていない。
採用している皆さんはそれぞれ独自で作成している様だが、systemdのユニットファイルの情報は殆どなく、今後作成する必要が出てくる人もいるだろうと思い、掲載する。

Type=は、simpleでも良いがRestart=alwaysが効かないので、forkingにしてある。systemdに監視・再起動させないのであればsimpleでも問題ない。

後は環境に合わせて調整して下さい。

送信デーモン用

/usr/lib/systemd/system/hulsndd.service
[Unit]
Description=HULFT send daemon(hulsndd)
After=syslog.target network.target

[Service]
Type=forking
Environment=PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/HULFT/bin
Environment=HULEXEP=/opt/HULFT/bin
Environment=HULPATH=/opt/HULFT/etc
ExecStart=/opt/HULFT/bin/hulsndd
ExecStop=/opt/HULFT/bin/utlkillsnd
Restart=always

[Install]
WantedBy=multi-user.target

受信デーモン用

/usr/lib/systemd/system/hulrcvd.service
[Unit]
Description=HULFT receive daemon(hulrcvd)
After=syslog.target network.target

[Service]
Type=forking
Environment=PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/HULFT/bin
Environment=HULEXEP=/opt/HULFT/bin
Environment=HULPATH=/opt/HULFT/etc
ExecStart=/opt/HULFT/bin/hulrcvd
ExecStop=/opt/HULFT/bin/utlkillrcv
Restart=always

[Install]
WantedBy=multi-user.target
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?