LoginSignup
5
5

More than 5 years have passed since last update.

systemd - Unitファイル(サービス起動ファイル)をカスタマイズする

Last updated at Posted at 2015-03-10
# ここにファイルを作る
$ vim /etc/systemd/system/nrpe.service

# 例えばこう
[Unit]
Description=NRPE(custom)
After=network.target
Requires=network.target

[Service]
Type=forking
User=nagios
Group=nagios
EnvironmentFile=/etc/sysconfig/nrpe
ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d $NRPE_SSL_OPT

[Install]
WantedBy=multi-user.target


$ systemctl reenable nrpe.service
rm '/etc/systemd/system/multi-user.target.wants/nrpe.service'
ln -s '/etc/systemd/system/nrpe.service' '/etc/systemd/system/multi-user.target.wants/nrpe.service'

$ systemctl restart nrpe.service # 要るかな?

大事なこと

/usr/lib 配下はさすがに編集NGだから!!!1

参考

5
5
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
5
5