Пример юнита для systemd

Материал из BiTel WiKi

(Различия между версиями)
Перейти к: навигация, поиск
(Синтаксис After и Requires)
Строка 20: Строка 20:
[Unit]
[Unit]
Description=BGBilling Server Daemon
Description=BGBilling Server Daemon
-
After=network.target,mysql.service,activemq.service
+
After=network.target mysql.service activemq.service
-
Requires=mysql.service,activemq.service
+
Requires=mysql.service activemq.service
[Service]
[Service]
Type=forking
Type=forking
ExecStartPre=/opt/bgbilling/BGBillingServer/script/bgcommonrc checkmysql
ExecStartPre=/opt/bgbilling/BGBillingServer/script/bgcommonrc checkmysql
-
ExecStart=/opt/bgbilling/BGBillingServer/script/bgbilling start
+
ExecStart=/opt/bgbilling/BGBillingServer/server_start.sh
-
ExecStop=/opt/bgbilling/BGBillingServer/script/bgbilling stop
+
ExecStop=/opt/bgbilling/BGBillingServer/server_stop.sh
[Install]
[Install]

Версия 11:34, 13 июля 2016

Данные юниты используются в образах виртуальных машин.

Activemq

[Unit]
Description=Apache ActiveMQ Daemon
After=network.target
Requires=
 
[Service]
Type=forking
ExecStart=/opt/activemq/apache-activemq-5.9.1/bin/linux-x86-64/activemq start
ExecStop=/opt/activemq/apache-activemq-5.9.1/bin/linux-x86-64/activemq stop
 
[Install]
WantedBy=multi-user.target

BGBillingServer

[Unit]
Description=BGBilling Server Daemon
After=network.target mysql.service activemq.service
Requires=mysql.service activemq.service
 
[Service]
Type=forking
ExecStartPre=/opt/bgbilling/BGBillingServer/script/bgcommonrc checkmysql
ExecStart=/opt/bgbilling/BGBillingServer/server_start.sh
ExecStop=/opt/bgbilling/BGBillingServer/server_stop.sh
 
[Install]
WantedBy=multi-user.target

BGCRM

[Unit]
Description=BGCRM Daemon
After=network.target
Requires=
 
[Service]
Type=forking
ExecStart=/opt/BGCRM/crm.sh start
ExecStop=/opt/BGCRM/crm.sh stop
 
[Install]
WantedBy=multi-user.target
Личные инструменты