[ https://issues.apache.org/jira/browse/KARAF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15108306#comment-15108306 ]
ASF GitHub Bot commented on KARAF-4281: --------------------------------------- GitHub user lburgazzoli opened a pull request: https://github.com/apache/karaf/pull/132 KARAF-4281 - System scripts: provide Systemd templates to manage Kara… …f child instances You can merge this pull request into a Git repository by running: $ git pull https://github.com/lburgazzoli/apache-karaf KARAF-4281 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/karaf/pull/132.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #132 ---- commit bc9b83bcedbd136ef1f0548770d08d444f6701e7 Author: lburgazzoli <lburgazz...@gmail.com> Date: 2016-01-20T09:46:56Z KARAF-4281 - System scripts: provide Systemd templates to manage Karaf child instances ---- > System scripts: provide Systemd templates to manage Karaf child instances > ------------------------------------------------------------------------- > > Key: KARAF-4281 > URL: https://issues.apache.org/jira/browse/KARAF-4281 > Project: Karaf > Issue Type: New Feature > Components: karaf-os-integration > Reporter: Luca Burgazzoli > Assignee: Freeman Fang > Priority: Minor > > Systemd's has as a sort of template-engine for unit files which are defined > in the form of template-name@.service, i.e. for karaf I've created one named > karaf@.service with content like: > {code} > [Unit] > Description=Karaf - %i > After=syslog.target network.target > [Service] > EnvironmentFile=-/etc/karaf/karaf.conf > Environment=JAVA_HOME=/opt/java/1.8.0 > Environment=KARAF_HOME=/opt/apache/karaf-4 > Environment=KARAF_BASE=/opt/apache/karaf-4/instances/%i > ExecStart=/opt/apache/karaf-4/bin/karaf daemon > ExecStop=/opt/apache/karaf-4/bin/karaf stop > LimitNOFILE=102642 > [Install] > WantedBy=multi-user.target > {code} > With such configuration, you do not need to create a systemd unit file for > each child instance but you can leverage karaf@.service, i.e: > {code} > systemctl start karaf@instance-1 > {code} > A service created in such way can also be configured to auto-start at boot > like any other Systemd unit: > {code} > [lb@home]# systemctl enable karaf@instance-1 > Created symlink from /etc/systemd/system/multi-user.target.wants > /karaf@instance-1.service to /etc/systemd/system/karaf@.service. > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)