From owner-freebsd-pkg@freebsd.org Thu Dec 3 11:34:28 2020 Return-Path: Delivered-To: freebsd-pkg@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E45A14A3CB2 for ; Thu, 3 Dec 2020 11:34:28 +0000 (UTC) (envelope-from sparvu@kronometrix.org) Received: from mail.kronometrix.org (mail.kronometrix.org [79.134.105.182]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.kronometrix.org", Issuer "mail.kronometrix.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cmtz84pr0z3hCJ; Thu, 3 Dec 2020 11:34:28 +0000 (UTC) (envelope-from sparvu@kronometrix.org) Received: from [192.168.1.151] (82-203-142-141.bb.dnainternet.fi [82.203.142.141]) (authenticated bits=0) by mail.kronometrix.org (8.16.1/8.15.2) with ESMTPSA id 0B3BYJG3064232 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 3 Dec 2020 11:34:25 GMT (envelope-from sparvu@kronometrix.org) X-Authentication-Warning: mail.kronometrix.org: Host 82-203-142-141.bb.dnainternet.fi [82.203.142.141] claimed to be [192.168.1.151] From: Stefan Parvu Message-Id: <07DB2BAA-F7DF-4BFF-900D-C9E33A51AFF3@kronometrix.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: FreeBSD 11.4 / 12.2 pkg-install problems startup service Date: Thu, 3 Dec 2020 13:34:14 +0200 In-Reply-To: <20201203103544.omchaeelpaaylwll@ivaldir.net> Cc: freebsd-pkg@freebsd.org To: Baptiste Daroussin References: <20201203103544.omchaeelpaaylwll@ivaldir.net> X-Mailer: Apple Mail (2.3654.20.0.2.21) X-Rspamd-Queue-Id: 4Cmtz84pr0z3hCJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2020 11:34:28 -0000 thanks for message. > I would like to know more about your use cases, it is not recent that = pkg > prevent starting automatically daemon during the install phases, pkg = becomes the > reaper of the scripts it does run and at the end of the run it kills = all the > children process (including any daemon that may have been started). aha. okay that might explain why i dont see anything running after = adding my own package. First of all, the things are something like that: Kronometrix Data = Recording [1] package is a software which collects various performance and availability data from a running system, which = installs under /opt/kronometrix prefix.=20 Under there I have a number of CLI utilities (Perl5 scripts), called = recorders which can run interactively or in background.=20 These CLIs are automatically started via a master script called rec, = found under /opt/kronometrix/etc. I have made the=20 correspondent master rc.d script which will be called during system boot = from /etc/rc.d . It works great.=20 Kronometrix Prefix System Boot /opt/kronometrix/etc/rec /etc/rc.d/kdr Same time, under the same data recording module, I have another script, = which has been designed as a real daemon , written in Perl5 too, with its own startup script = /opt/kronometrix/etc/transport and with a correspondent /etc/rc.d, called kdr_transport=20 Kronometrix Prefix System Boot /opt/kronometrix/etc/transport /etc/rc.d/kdr_transport=20 Now, all sfw is packaged under a FreeBSD binary pkg for easy deployment. = I would like to be able during pkg add phase to start as well the recorders and transport utilities, if possible.=20 What is different? First of all, I made a mistake. This has NOT worked okay before 12.2. = The recorders and transport utilities have never run after pkg add. I had to manually start them. What was different now = with 12.2 is that if I try to install my FreeBSD package, the pkg add gets stuck and requires CTRL-C to break. = Otherwise it will sit like that, forever =E2=80=A6 This is visible under 12.2 and 11.4 - not visible in 12.1 or 11.2 or 10.4 >=20 >=20 > Stopping and starting daemons etc, is not package management in the = first place, > it is configuration management, the two concept are different for a = reason. >=20 > That said because we know a lot of people have been doing that for a = while, pkg > has an option (off by default) HANDLE_RC_SCRIPT >=20 > if you set it to true when installing your package it will start the = rc.d script > so you don't need to install that in your post install script. Okay. Thanks for tip. Let me try that. Thanks a lot for comments, Stefan