Resolution
cd /etc/systemd/system
sudo vi fusion.service
[Unit]
Description=AES fusion Application
Requires=network-online.target
After=network-online.target
[Service]
Type=simple
User=opsadminuser
ExecStart=/bin/sh -c '/opt/lucidworks/fusion/4.2.1/bin/fusion start > /opt/lucidworks/fusion/4.2.1/var/log/app-start.log 2>&1'
RemainAfterExit=yes
ExecStop=/bin/sh -c '/opt/lucidworks/fusion/4.2.1/bin/fusion stop > /opt/lucidworks/fusion/4.2.1/var/log/app-stop.log 2>&1'
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo chmod 755 fusion.service
sudo systemctl daemon-reload
sudo systemctl enable fusion.service
Step 1:
Create a START.sh
/usr/bin/java -jar -Dspring.profiles.active=dev
-Dlog.file=/opt/java/aes_logs/aes_logs
/opt/java/iot/dtc-services-boot-smartfactory-0.0.1-SNAPSHOT-exec.jar
--spring.config.name=application -Xms2G -Xmx4G -XX:+UseG1GC
-XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5
-XX:InitiatingHeapOccupancyPercent=70 -XX:-UseGCOverheadLimit
Step 2:
Go to /etc/systemd/system
Step 3:
then after create a example.service file
EXAMPLE 1:
[Unit]
Description=Smart Factory Application
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple
User=opsadminuser
ExecStart=/bin/sh -c '/opt/java/iot/connector-start.sh > /opt/java/iot/logs/app.log 2>&1'
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
EXAMPLE 2:
[Unit]
Requires=zookeeper.service
After=zookeeper.service
[Service]
Type=simple
User=opsadminuser
ExecStart=/bin/sh -c '/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties > /opt/kafka/logs/kafka.log 2>&1'
ExecStop=/opt/kafka/bin/kafka-server-stop.sh
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
No comments:
Post a Comment