From nobody Thu Jul 06 14:48:15 2023 X-Original-To: freebsd-rc@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 4QxfXv53MVz4lQl4 for ; Thu, 6 Jul 2023 14:48:31 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QxfXt2msFz4Nwj for ; Thu, 6 Jul 2023 14:48:30 +0000 (UTC) (envelope-from mpp302@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=mpp302@gmail.com; dmarc=none Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4009fd0d397so1911871cf.0 for ; Thu, 06 Jul 2023 07:48:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688654909; x=1691246909; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wNSbRU37FmIzMc4k18lBShLMZAXMj3U5gwJss+qT/Zc=; b=E/ed7stZ/ZIEhN5J+aXoUQ9WpihRYs6Dyqo715jAYTztuRspPsWJM9S7v7YSnHO9xq rVpCV8Y5MDbvJFQN+16FtASoSIU/LTvDm6BHGqrFEbv0SC5h/uSSzvrIM97AauzKtGz8 q5ND+VUVLIrp5eGH+ub5jBpORWxlF0SCevGEMXZT9DZpaOz03uGnsRaCFJOMZJWJzkSx Z+o6ipaNN9++OzE65ftsAsCTST0eCPnOLf+PXrrHmONl5vD6D7Ajt4+XJGNYqm7xAJ1Q OvhPesExC3K5Ik38sJxytkqnnyBOi1pbqKbxFm/otyuKxyX1GpTjIZI4+IYJMCRDG4ZN 2Pyg== X-Gm-Message-State: ABy/qLZu+87tZhIND5Al2rmL9J2vH5aX/J4g/s3uND1uUzye6sDFaet+ 872F1YLYbJzJrPWlgA7LwYgkhKfYm9JqCg== X-Google-Smtp-Source: APBJJlEXMgjlRyIh7LaNjxxhBFCAPtNDvW1EalNXKc1/TttG+ZegUyUh7yhSlOeDcfauZ9W1WdPJlA== X-Received: by 2002:ad4:5d6a:0:b0:636:e4f:6b88 with SMTP id fn10-20020ad45d6a000000b006360e4f6b88mr2275004qvb.1.1688654908766; Thu, 06 Jul 2023 07:48:28 -0700 (PDT) Received: from smtpclient.apple (ip5f5af05a.dynamic.kabel-deutschland.de. [95.90.240.90]) by smtp.gmail.com with ESMTPSA id n14-20020a0ce48e000000b006375f9fd170sm946425qvl.34.2023.07.06.07.48.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jul 2023 07:48:28 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Discussion related to /etc/rc.d design and implementation List-Archive: https://lists.freebsd.org/archives/freebsd-rc List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-rc@freebsd.org X-BeenThere: freebsd-rc@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: detailed manual for rc scripting From: Mateusz Piotrowski <0mp@FreeBSD.org> In-Reply-To: Date: Thu, 6 Jul 2023 16:48:15 +0200 Cc: freebsd-rc@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9A3F1FA1-37F0-402B-8C94-536480E15E90@FreeBSD.org> References: To: Miroslav Lachman <000.fbsd@quip.cz> X-Mailer: Apple Mail (2.3731.600.7) X-Spamd-Result: default: False [-2.49 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.995]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-rc@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[209.85.160.175:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com]; MLMMJ_DEST(0.00)[freebsd-rc@freebsd.org]; RCPT_COUNT_TWO(0.00)[2]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.160.175:from] X-Rspamd-Queue-Id: 4QxfXt2msFz4Nwj X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N Hey Miroslav, > On 2. Mar 2023, at 21:32, Miroslav Lachman <000.fbsd@quip.cz> wrote: >=20 > I would like to know if there is something more than = https://docs.freebsd.org/en/articles/rc-scripting/ and man rc.subr(8)? >=20 > Every now and then I need to write some rc script for customer = services or fix some existing rc script which became broken after update = of base or some packages. Starting the interpreted (node.js, python = etc.) services are often way more complicated than what is described in = handbook but I always spend about 30% of time by doing the start part = and 70% of doing the part required to stop the service - matching = command / interpreter / procname is not an easy task and debugging it is = even more complicated. Almost always one need to tune just these 3 = variables command, command_interpreter, procname but it is sometimes too = difficult if one do not have deep knowledge of how things works in = rc.subr and sometimes even reading the source of rc.subr is not clear to = me. > So is there some detailed manual how to put things together in edge = cases where service is interpreted, running from Pyhton virtualenv, = there are symlinks in path so the real path shown by "ps" is different = than the path used to start the service and so on. I'm afraid there is nothing else. Regarding the services running interpreted programs, I agree that the = interface could be a bit more friendly. Best, Mateusz=