From nobody Sat Feb 03 16:05:20 2024 X-Original-To: ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRyCw5Sdyz59dpR for ; Sat, 3 Feb 2024 16:05:32 +0000 (UTC) (envelope-from SRS0=Ta0Z=JM=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRyCv0nmNz4NhF for ; Sat, 3 Feb 2024 16:05:30 +0000 (UTC) (envelope-from SRS0=Ta0Z=JM=quip.cz=000.fbsd@elsa.codelab.cz) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=quip.cz header.s=private header.b=qCCXPP7a; dkim=pass header.d=quip.cz header.s=private header.b=55PtOSYZ; dmarc=none; spf=none (mx1.freebsd.org: domain of "SRS0=Ta0Z=JM=quip.cz=000.fbsd@elsa.codelab.cz" has no SPF policy when checking 94.124.105.4) smtp.mailfrom="SRS0=Ta0Z=JM=quip.cz=000.fbsd@elsa.codelab.cz" Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id F3F3AD78AA for ; Sat, 3 Feb 2024 17:05:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quip.cz; s=private; t=1706976322; bh=FakxseVOBCleWGJ3QDlLrVEe4YegYjZFXL2wQScQXwI=; h=Date:Subject:To:References:From:In-Reply-To; b=qCCXPP7a3fXmmB7YuG+srRtgaDoiwO/InQS9rHo+AcWUZ7pzwuzF9B9c2Ajj/FpzM t2K0QS923BJ26n3ld+T0I5dYny3092OnpcyghCXoAfTwnhkPCRadEDB7c6Pd/z4MzU 2apx9SFuObSVzkXqmNUy+Byd2Vrk0gmeyoXJce78= Received: from [192.168.145.49] (ip-89-177-27-225.bb.vodafone.cz [89.177.27.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 9B398D7894 for ; Sat, 3 Feb 2024 17:05:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quip.cz; s=private; t=1706976320; bh=FakxseVOBCleWGJ3QDlLrVEe4YegYjZFXL2wQScQXwI=; h=Date:Subject:To:References:From:In-Reply-To; b=55PtOSYZ6lbAF2EGKUeklM7G+7cUZqMNQH67Z8+VoRmJHMeBphdYWUbnJKfEePsVw vBmcFaQ09oGDX7FQQ+CVbfzie+qODaD9l2twQj3cILsfmGA7O+YiFsFiz2uR/vIBCt N52RQkenr1XrHezhxhz8GZBeMyU03HaJ7OqirlY4= Message-ID: <5336ee37-7966-4745-97c4-9ce41570d6be@quip.cz> Date: Sat, 3 Feb 2024 17:05:20 +0100 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Troubles with Kibana Content-Language: en-US To: ports@freebsd.org References: <954b15e9-7522-439a-a9e0-188f7b0056c9@netfence.it> From: Miroslav Lachman <000.fbsd@quip.cz> In-Reply-To: <954b15e9-7522-439a-a9e0-188f7b0056c9@netfence.it> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[000.fbsd@quip.cz,SRS0=Ta0Z=JM=quip.cz=000.fbsd@elsa.codelab.cz]; R_DKIM_ALLOW(-0.20)[quip.cz:s=private]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; R_SPF_NA(0.00)[no SPF record]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[quip.cz]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:42000, ipnet:94.124.104.0/21, country:CZ]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; MLMMJ_DEST(0.00)[ports@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[000.fbsd@quip.cz,SRS0=Ta0Z=JM=quip.cz=000.fbsd@elsa.codelab.cz]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[ports@freebsd.org]; DKIM_TRACE(0.00)[quip.cz:+] X-Rspamd-Queue-Id: 4TRyCv0nmNz4NhF On 03/02/2024 16:24, Andrea Venturoli wrote: > Hello. > > I've got a 13.2p9/amd64 server where I have a jail dedicated to > ElasticSearch+Kibana and I'm having troubles starting and stopping the > latter. > >> # pkg info | grep -E "(elastic|kibana)" >> elasticsearch8-8.11.3          Distributed, RESTful search and >> analytics engine >> kibana8-8.11.3                 Browser based analytics and search >> interface to ElasticSearch >> py39-elasticsearch-7.17.9      Official Python low-level client for >> Elasticsearch >> py39-elasticsearch-dsl-7.3.0   High level Python client for Elasticsearch > >> # cat /etc/rc.conf >> #cron_enable="NO" >> kibana_enable="YES" >> kibana_syslog_output_enable="YES" >> elasticsearch_enable="YES" > > First problem > > When I start the jail (with "ezjail-admin start") Elastic starts, but > Kibana does not. > syslog shows: >> [2024-02-03T16:14:21.861+01:00][INFO ][root] Kibana is starting >> [2024-02-03T16:14:21.939+01:00][INFO ][root] Kibana is shutting down >> [2024-02-03T16:14:21.939+01:00][FATAL][root] Reason: EACCES: >> permission denied, open '/var/run/kibana.pid' >> Error: EACCES: permission denied, open '/var/run/kibana.pid' >> >>  FATAL  Error: EACCES: permission denied, open '/var/run/kibana.pid' > > Same happens if I try "service kibana start" afterwards from inside the > jail. > I can get around this with: >> # touch /var/run/kibana.pid >> # chown www /var/run/kibana.pid >> # service kibana start > > However this must be done manually everytime I need to restart the > server or jail. Both, the first and the second problem are caused by permissions problem on PID file. I no longer use Kibana, but if Kibana is running as user www and tries to write to /var/run/ as that user, it must fail. But a quick look at the rc.d/kibana [1] show that the PID file should be written to subdirectory /var/run/kibana/kibana.pid Do you have any local modification to the path of the PID file? (for example, in the kibana.yml file) /var/run/kibana/ is created by rc.d/kibana with the correct owner and permissions, so "it should work". Try to figure out why your Kibana is trying to write /var/run/kibana.pid instead of /var/run/kibana/kibana.pid. > Second problem > > When I try to stop Kibana, it just hangs indefinitely: >>  # service kibana stop >> Stopping kibana. >> Waiting for PIDS: 28179 > > syslog reports: >> [2024-02-03T16:20:22.309+01:00][INFO ][root] SIGTERM received - >> initiating shutdown >> [2024-02-03T16:20:22.309+01:00][INFO ][root] Kibana is shutting down >> [2024-02-03T16:20:22.311+01:00][INFO ][plugins-system.standard] >> Stopping all plugins. >> [2024-02-03T16:20:22.314+01:00][INFO >> ][plugins.monitoring.monitoring.kibana-monitoring] Monitoring stats >> collection is stopped >> [2024-02-03T16:20:22.323+01:00][INFO ][plugins-system.standard] All >> plugins stopped. >> [2024-02-03T16:20:22.324+01:00][WARN ][environment] Detected an >> unhandled Promise rejection: Error: EACCES: permission denied, unlink >> '/var/run/kibana.pid' ^^^ PID file cannot be deleted as user www because parent dir is owned by root and no one else can write to it. [1] https://cgit.freebsd.org/ports/tree/textproc/kibana8/files/kibana.in Kind regards Miroslav Lachman