0
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.

OTRSのsystemd UNITファイルを作ってみた

Last updated at Posted at 2016-11-29

CentOS7にOTRS5を作ってみましたが、OTRS5向けのsystemdのservice unitファイルがなかったので、こちらを参考に作ってみました。

参考

Systemd(RHEL7)でOTRS4を稼動させるためのTIPS
http://d.hatena.ne.jp/hsts/20150119/1421653175

注意

OTRS5は、バイナリ版が公開されているので、それをインストールし、他の必要なパッケージもインストール&設定をしてください。

OTRSバイナリパッケージ
https://www.otrs.com/download-open-source-help-desk-software-otrs-free/

OTRSドキュメント
http://otrs.github.io/doc/manual/admin/stable/en/html/index.html

手順

1.ファイルのダウンロード

OTRS5用に改変したsystemd.unitファイルは、こちらからダウンロードできます。

otrs.serviceファイルの配置先
https://github.com/htakeda/centos7-otrs5-systemd

内容は、投稿日現在こんな感じです。

[Unit]
Description=OTRS: Open-source Ticket Request System, Copyright (C) 2001-2016 OTRS AG
Documentation=https://otrs.github.io/doc/manual/admin/stable/en/html/
Requires=crond.service httpd.service mariadb.service dovecot.service postfix.service
After=crond.service httpd.service mariadb.service dovecot.service postfix.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/opt/otrs/bin/otrs.Daemon.pl start
ExecStart=/opt/otrs/bin/Cron.sh start
ExecStop=/opt/otrs/bin/Cron.sh stop
ExecStop=/opt/otrs/bin/otrs.Daemon.pl stop
User=otrs
Group=apache

[Install]
WantedBy=multi-user.target

2.ダウンロードしたファイルを以下のパスに配置します。

/usr/lib/systemd/system/

※ chownで権限など変更してください。

3.メールサーバやWebサーバの変更(必要な方)
メールとWebサーバは以下をRequiresとAfterに設定しました。
変更が必要な方は、変更してください。

メール:dovecot postfix
Webサーバ:httpd

変更した場合、以下のコマンドで更新する必要があります。
systemcrl daemon-reload

4.otrsを起動してみます。

systemctl start otrs.service

5.状態を確認します。
このような感じでデーモンが起動していたらOKです。

# systemctl status otrs
● otrs.service - OTRS: Open-source Ticket Request System, Copyright (C) 2001-2012 OTRS AG
   Loaded: loaded (/usr/lib/systemd/system/otrs.service; disabled; vendor preset: disabled)
   Active: active (exited) since 火 2016-11-29 22:53:50 JST; 1min 53s ago
     Docs: https://otrs.github.io/doc/manual/admin/stable/en/html/
  Process: 3183 ExecStart=/opt/otrs/bin/Cron.sh start (code=exited, status=0/SUCCESS)
  Process: 3172 ExecStart=/opt/otrs/bin/otrs.Daemon.pl start (code=exited, status=0/SUCCESS)
 Main PID: 3183 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/otrs.service
           ├─3178 /usr/bin/perl -X /opt/otrs/bin/otrs.Daemon.pl start
           ├─3179 /usr/bin/perl -X /opt/otrs/bin/otrs.Daemon.pl start
           ├─3180 /usr/bin/perl -X /opt/otrs/bin/otrs.Daemon.pl start
           ├─3181 /usr/bin/perl -X /opt/otrs/bin/otrs.Daemon.pl start
           └─3182 /usr/bin/perl -X /opt/otrs/bin/otrs.Daemon.pl start
  1. WebでOTRSにログインしてみましょう。
    OTRSのデーモンが起動していない場合、画面上にメッセージが出てくるはずです。
0
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
0
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?