Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1C74018C38 for ; Thu, 21 Jan 2016 02:19:40 +0000 (UTC) Received: (qmail 91992 invoked by uid 500); 21 Jan 2016 02:19:40 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 91975 invoked by uid 500); 21 Jan 2016 02:19:40 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 91955 invoked by uid 99); 21 Jan 2016 02:19:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2016 02:19:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D3FED2C1F58 for ; Thu, 21 Jan 2016 02:19:39 +0000 (UTC) Date: Thu, 21 Jan 2016 02:19:39 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KARAF-4281) System scripts: provide Systemd templates to manage Karaf child instances MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15109914#comment-15109914 ] ASF GitHub Bot commented on KARAF-4281: --------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/karaf/pull/132 > 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)