{"id":1160,"date":"2017-03-13T16:27:23","date_gmt":"2017-03-13T08:27:23","guid":{"rendered":"http:\/\/blog.amjet.biz\/IT\/?p=1160"},"modified":"2017-03-13T16:30:46","modified_gmt":"2017-03-13T08:30:46","slug":"centos-%e4%bb%a5-systemd-%e7%ae%a1%e7%90%86-wildfy","status":"publish","type":"post","link":"https:\/\/blog.amjet.biz\/IT\/?p=1160","title":{"rendered":"CentOS \u4ee5 systemd \u7ba1\u7406 wildfy"},"content":{"rendered":"<p>WildFly \u662f JBoss AP \u7684\u5f8c\u7e7c\u7248\u672c\uff0c\u6df5\u6e90\u53ef\u4ee5\u53c3\u8003\u9019\u500b <a href=\"https:\/\/www.theregister.co.uk\/2013\/04\/22\/jboss_as_becomes_wildfly\/\" target=\"_blank\">\u7db2\u5740<\/a><\/p>\n<p>\u555f\u52d5 WildFly \u7684\u6307\u4ee4\u662f<br \/>\n&lt;WILDFLY_HOME&gt;\/bin\/standalone.sh<\/p>\n<p>\u505c\u6b62 WildFly \u7684\u6307\u4ee4\u662f<br \/>\n&lt;WILDFLY_HOME&gt;\/bin\/jboss-cli.sh &#8211;connect command=:shutdown<\/p>\n<p>\u4ee5\u524d\u7684 CentOS \u8981\u5beb\u4e00\u652f shell script \u63d0\u4f9b start, stop, restart \u7b49 method \u4f86\u7ba1\u7406\u670d\u52d9\uff0c\u73fe\u5728 systemd \u662f CentOS 7 \u7684\u9810\u8a2d\u670d\u52d9\u7ba1\u7406\u7a0b\u5f0f\uff0c\u4f5c\u6cd5\u8ddf\u904e\u53bb\u7248\u672c\u4e0d\u540c\u800c\u4e14\u7c21\u5316\u8a31\u591a\uff0c\u6b65\u9a5f\u5982\u4e0b<\/p>\n<p>1. \u5728 \/usr\/lib\/systemd\/system \u76ee\u9304\u5efa\u7acb wildfly.service \u6a94\u6848\u5167\u5bb9\u5982\u4e0b<\/p>\n<p>[Unit]<br \/>\nDescription=WildFly application server<br \/>\nAfter=network.target<\/p>\n<p>[Service]<br \/>\nType=simple<br \/>\nUser=jboss<br \/>\nGroup=jboss<br \/>\nExecStart=&lt;WILDFLY_HOME&gt;\/bin\/standalone.sh<\/p>\n<p># Give a reasonable amount of time for the server to start up\/shut down<br \/>\nTimeoutSec=300<\/p>\n<p>[Install]<br \/>\nWantedBy=multi-user.target<\/p>\n<p>2. \u5229\u7528\u4ee5\u4e0b\u6307\u4ee4\u555f\u7528 wildfly service<\/p>\n<p>systemctl enable wildfly<\/p>\n<p>3. \u7ba1\u7406 wildfly service<\/p>\n<p>systemctl start wildfly<br \/>\nsystemctl stop wildfly<\/p>\n<p>\u4ee5\u4e0a\u5167\u5bb9\u53c3\u8003\u9019\u500b <a href=\"http:\/\/kopibugis.blogspot.tw\/2015\/09\/adding-wildfly-as-systemd-service.html\" target=\"_blank\">\u7db2\u5740<\/a><\/p>\n<p>[ratings]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WildFly \u662f JBoss AP \u7684\u5f8c\u7e7c\u7248\u672c\uff0c\u6df5\u6e90\u53ef\u4ee5\u53c3\u8003\u9019\u500b \u7db2\u5740 \u555f\u52d5 WildFly \u7684\u6307\u4ee4\u662f &lt;WILDFLY_HOME&gt;\/bin\/standalone.sh \u505c\u6b62 WildFly \u7684\u6307\u4ee4\u662f &lt;WILDFLY_HOME&gt;\/bin\/jboss-cli.sh &#8211;connect command=:shutdown \u4ee5\u524d\u7684 CentOS \u8981\u5beb\u4e00\u652f shell script \u63d0\u4f9b start, stop, restart \u7b49 method \u4f86\u7ba1\u7406\u670d\u52d9\uff0c\u73fe\u5728 systemd \u662f CentOS 7 \u7684\u9810\u8a2d\u670d\u52d9\u7ba1\u7406\u7a0b\u5f0f\uff0c\u4f5c\u6cd5\u8ddf\u904e\u53bb\u7248\u672c\u4e0d\u540c\u800c\u4e14\u7c21\u5316\u8a31\u591a\uff0c\u6b65\u9a5f\u5982\u4e0b 1. \u5728 \/usr\/lib\/systemd\/system \u76ee\u9304\u5efa\u7acb wildfly.service \u6a94\u6848\u5167\u5bb9\u5982\u4e0b [Unit] Description=WildFly application server After=network.target [Service] Type=simple User=jboss Group=jboss ExecStart=&lt;WILDFLY_HOME&gt;\/bin\/standalone.sh # Give a reasonable amount of [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,8],"tags":[133,150],"class_list":["post-1160","post","type-post","status-publish","format-standard","hentry","category-centos","category-java","tag-java","tag-wildfly"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/1160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1160"}],"version-history":[{"count":4,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/1160\/revisions"}],"predecessor-version":[{"id":1164,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/1160\/revisions\/1164"}],"wp:attachment":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}