[PLUG] service in systemd not starting custom java app after rebooting RHEL 7.4
Ranjith R
ranjith_117 at yahoo.com
Wed Jul 4 16:29:16 IST 2018
Hello,
On Wednesday, 4 July, 2018, 2:43:27 PM IST, Amey Abhyankar <sco1984 at gmail.com> wrote:
Hello,
I am trying to create a service inside /etc/systemd/system & it's
softlink in /etc/systemd/system/multi-user.target.wants but it's not
helping.
After system reboot, if I do ps -ef |grep -i javaapp it's not started.
I would start by using systemctl status javaaap
Can somebody suggest best practices to make custom java application as
a service using systemd?
My current config of service as follows =
I copied mongodb conf file and created new service using appropriate parameters.
------------------------------------------------------
[Unit]
Description=javaapp service
After=network.target
[Service]
User=user1
Group=user1
#Environment="OPTIONS=-f /etc/mongod.conf"
ExecStart=/opt/user1/javaapp1/current/javaapp.sh $OPTIONS
#ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb
#ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb
#ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb
PermissionsStartOnly=true
PIDFile=/opt/user1/javaapp1/current/javaapp.pid
Type=forking
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
[Install]
WantedBy=multi-user.target
------------------------------------------------------
Default systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=simple
EnvironmentFile=/etc/tomcat/tomcat.conf
Environment="NAME="
EnvironmentFile=-/etc/sysconfig/tomcat
ExecStart=/usr/libexec/tomcat/server start
SuccessExitStatus=143
User=tomcat
[Install]
WantedBy=multi-user.target
The tomcat.conf has all the JAVA HOME settings
Regards,
Amey.
_______________________________________________
plug-mail mailing list
plug-mail at plug.org.in
http://list.plug.org.in/listinfo/plug-mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.plug.org.in/pipermail/plug-mail/attachments/20180704/3924e7e5/attachment.html>
More information about the plug-mail
mailing list