From nobody Mon Oct 3 20:55:58 2022 X-Original-To: freebsd-questions@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 4MhCmK6blLz4f966 for ; Mon, 3 Oct 2022 20:56:01 +0000 (UTC) (envelope-from carlj@peak.org) Received: from mail.nrtc.syn-alias.com (mail.nrtc.syn-alias.com [129.213.214.220]) (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 4MhCmJ3wkTz3CVj for ; Mon, 3 Oct 2022 20:56:00 +0000 (UTC) (envelope-from carlj@peak.org) X-Authed-Username: Y2FybGpAcGVhay5vcmc= Received: from [199.58.99.70] ([199.58.99.70:39479] helo=bay.localnet) by mail.peak.org (envelope-from ) (ecelerity 4.4.0.19839 r(msys-ecelerity:tags/4.4.0.0^0)) with ESMTPA id B7/62-17811-F5C4B336; Mon, 03 Oct 2022 16:55:59 -0400 Received: from carlj by bay.localnet with local (Exim 4.95 (FreeBSD)) (envelope-from ) id 1ofSTm-000Gdp-Ga for freebsd-questions@freebsd.org; Mon, 03 Oct 2022 13:55:58 -0700 From: Carl Johnson To: freebsd-questions@freebsd.org Subject: Re: Possible OS suggestion: make service status smarter about process runtime References: <8E0D7E65-CA5D-4338-B4A4-0875B7E30B56@gushi.org> Date: Mon, 03 Oct 2022 13:55:58 -0700 In-Reply-To: <8E0D7E65-CA5D-4338-B4A4-0875B7E30B56@gushi.org> (Dan Mahoney's message of "Mon, 3 Oct 2022 11:18:43 -0700") Message-ID: <86zgeceie9.fsf@bay.localnet> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (berkeley-unix) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-Vade-Verdict: clean X-Vade-Analysis-1: gggruggvucftvghtrhhoucdtuddrgedvfedrfeehledgudehgecutefuodetggdotefrodftvfcurfhr X-Vade-Analysis-2: ohhfihhlvgemucfujgfpteevqfftpdfptffvvedpgffpggdqpfftvfevpdfqfgfvnecuuegrihhlohhu X-Vade-Analysis-3: themuceftddunecunecujfgurhephffvufhfffgjkfgfgggtsehttddttddtredtnecuhfhrohhmpeev X-Vade-Analysis-4: rghrlhculfhohhhnshhonhcuoegtrghrlhhjsehpvggrkhdrohhrgheqnecuggftrfgrthhtvghrnhep X-Vade-Analysis-5: vdegffeujeduffeikeeftedtfedtleeluefhheefgfegfeeiudekgfeljeeiheegnecukfhppeduleel X-Vade-Analysis-6: rdehkedrleelrdejtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleel X-Vade-Analysis-7: rdehkedrleelrdejtddphhgvlhhopegsrgihrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpegtrghr X-Vade-Analysis-8: lhhjsehpvggrkhdrohhrghdprhgtphhtthhopehfrhgvvggsshguqdhquhgvshhtihhonhhssehfrhgv X-Vade-Analysis-9: vggsshgurdhorhhgpdhmthgrhhhoshhtpehsmhhtphdtuddrnhhrthgtrdgvmhgrihhlqdgrshhhuddr X-Vade-Analysis-10: shihnhgtrdhlrghnpdhnsggprhgtphhtthhopedupdhishgpnhgrpehtrhhuvgdptehuthhhpghushgv X-Vade-Analysis-11: rheptggrrhhljhesphgvrghkrdhorhhg X-Vade-Client: NRTC X-Rspamd-Queue-Id: 4MhCmJ3wkTz3CVj X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=peak.org; spf=pass (mx1.freebsd.org: domain of carlj@peak.org designates 129.213.214.220 as permitted sender) smtp.mailfrom=carlj@peak.org X-Spamd-Result: default: False [-3.80 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[peak.org,none]; R_SPF_ALLOW(-0.20)[+ip4:129.213.214.220]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[129.213.214.220:from]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:31898, ipnet:129.213.208.0/21, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[129.213.214.220:from] X-ThisMailContainsUnwantedMimeParts: N Dan Mahoney writes: > Hey all, > > There's no mailing list for "rc" commands so I'm putting this in generic questions. > > We've recently done some pkg upgrades and would like to restart the various services. > > It occurs to me that since the rc subsystem knows the command > involved, (say, /usr/local/sbin/httpd), and already looks at the > process table and the pid file to figure out if it's running, It's > also possible to extend the output of service foo status to print how > long a service has been running. > > Further, this could be extended such that there was a way of telling, > post pkg upgrade or post freebsd-update install, which services were > in need of a restart. (I.e. which files had mtimes newer than their > runtimes). > > Thoughts on this? Is it worth a feature request? You might want to look into the checkrestart port/package to tell you which services need to be restarted. -- Carl Johnson carlj@peak.org