From owner-freebsd-rc@freebsd.org Sun Jul 28 21:00:09 2019 Return-Path: Delivered-To: freebsd-rc@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 237BDB3DAD for ; Sun, 28 Jul 2019 21:00:09 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id E48807653D for ; Sun, 28 Jul 2019 21:00:08 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id 8B6F8B3DA7; Sun, 28 Jul 2019 21:00:08 +0000 (UTC) Delivered-To: rc@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 8B227B3DA6 for ; Sun, 28 Jul 2019 21:00:08 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69E9876530 for ; Sun, 28 Jul 2019 21:00:08 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D9721D88C for ; Sun, 28 Jul 2019 21:00:07 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x6SL0720055885 for ; Sun, 28 Jul 2019 21:00:07 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x6SL07UQ055884 for rc@FreeBSD.org; Sun, 28 Jul 2019 21:00:07 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201907282100.x6SL07UQ055884@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: rc@FreeBSD.org Subject: Problem reports for rc@FreeBSD.org that need special attention Date: Sun, 28 Jul 2019 21:00:07 +0000 MIME-Version: 1.0 X-Rspamd-Queue-Id: 69E9876530 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2019 21:00:09 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 178818 | gmirror savecore support / gmirror(8) says to use Open | 235122 | rc.subr limits call breaks non-root usage 2 problems total for which you should take action. From owner-freebsd-rc@freebsd.org Thu Aug 1 13:17:18 2019 Return-Path: Delivered-To: freebsd-rc@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 35FFCBD7D4; Thu, 1 Aug 2019 13:17:18 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zrRx1gx3z4d1D; Thu, 1 Aug 2019 13:17:16 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pg1-f173.google.com with SMTP id i18so34200350pgl.11; Thu, 01 Aug 2019 06:17:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:openpgp:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=znxSz+RObypHhIb+VNBPGcSNHT5/paH1NLG4CeX+pMo=; b=YGbxQUWBDLmrg3/4uaa7cRhrUwTmrTovQheHNVvDk6twUtOttKXNBWHHrjQY38Bh08 4JXZzVQAkuOItjU6kEZe6P+5T3N2a3qyDk6QxwGCoaeEY6FfZEBth79tecsMBPeZ3ouS 93BxzXOm3how+zyVRmrWFOQ5zNnNjy9Ih8pa1RqKaKR4+jDgaDMIrHx4EkEpBguKe1bR p7nwbx+MPLqHDhTxS3X1lrkq5TqbdBHmSuFb/B/gnsVu4ALMpsNfRMjAYwm/1LQL9XoU hhhERs1XSSMGVFERvXMyCKaraN+5jXIjdOqLBqf8BAmLDAslE5Ble4WaCEoIq3dbHMSR 3hTw== X-Gm-Message-State: APjAAAVp4n13fG6OjVoAK9s9oSXMqNNFs8M2Rzy1PxN45o46cTQ7Tg8K LNYqedm3IrobHcDMb/XLdw/7tok2Rs8= X-Google-Smtp-Source: APXvYqxPyR3gI9PYKLkB63hAwSq/Rw+fRp931XNf4gukSWf/lPu4fc7XpI5eEnJOtELMs24bNfg6Cw== X-Received: by 2002:a62:26c1:: with SMTP id m184mr51299629pfm.200.1564665434961; Thu, 01 Aug 2019 06:17:14 -0700 (PDT) Received: from [192.168.1.36] (broadband-95-106-143-130.atc.tvcom.ru. [95.106.143.130]) by smtp.googlemail.com with ESMTPSA id b26sm81417394pfo.129.2019.08.01.06.17.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 06:17:13 -0700 (PDT) To: freebsd-rc@freebsd.org Cc: FreeBSD Current From: Andriy Gapon Subject: rc script: manual stop vs system shutdown Openpgp: preference=signencrypt Message-ID: <2e50fb67-8a19-412b-19d2-14f5f20b61f8@FreeBSD.org> Date: Thu, 1 Aug 2019 16:17:09 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 45zrRx1gx3z4d1D X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.215.173 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-5.13 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-3.14)[ip: (-9.80), ipnet: 209.85.128.0/17(-3.41), asn: 15169(-2.45), country: US(-0.05)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[173.215.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[173.215.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[130.143.106.95.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 13:17:18 -0000 Is it possible in an rc script to distinguish between a manual stop (e.g., service foo stop) and a stop during a system shutdown (via rc.shutdown) ? Are there any marker variables for that? Or something in the global system state? Thanks! -- Andriy Gapon From owner-freebsd-rc@freebsd.org Thu Aug 1 15:53:35 2019 Return-Path: Delivered-To: freebsd-rc@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 BE109C0D0F; Thu, 1 Aug 2019 15:53:35 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zvwG4c2Wz3Jp5; Thu, 1 Aug 2019 15:53:34 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x71FrTE8060253; Thu, 1 Aug 2019 08:53:29 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x71FrTCd060252; Thu, 1 Aug 2019 08:53:29 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> Subject: Re: rc script: manual stop vs system shutdown In-Reply-To: <2e50fb67-8a19-412b-19d2-14f5f20b61f8@FreeBSD.org> To: Andriy Gapon Date: Thu, 1 Aug 2019 08:53:29 -0700 (PDT) CC: freebsd-rc@freebsd.org, FreeBSD Current X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 45zvwG4c2Wz3Jp5 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.94 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; IP_SCORE(0.04)[ip: (0.14), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 15:53:35 -0000 > > Is it possible in an rc script to distinguish between a manual stop > (e.g., service foo stop) and a stop during a system shutdown (via > rc.shutdown) ? > Are there any marker variables for that? > Or something in the global system state? Not that I can think of, but I like this idea, I am sure that use cases exist. > Andriy Gapon -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-rc@freebsd.org Thu Aug 1 16:12:46 2019 Return-Path: Delivered-To: freebsd-rc@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 958A7C132E for ; Thu, 1 Aug 2019 16:12:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zwLP5TQKz3Ks5 for ; Thu, 1 Aug 2019 16:12:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id r6so52482253qkc.0 for ; Thu, 01 Aug 2019 09:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GVUmyYuw5MQQkJncH6smJLvmNEJ8m9cu4tEqzvH982s=; b=hGXdmzazdWanvWfZdd7OA0ljzBYQ+lkMdiaM4bpP7taHOIuvaBncqolVNkVYVNJZnA OHA9NQcJjPTEfUOF6MwDGd54JIUzn499M881WDbhFRP7pL1ib8Y9AMqMbU1j2dBkoFP5 JR/NSBjy4l7oTgmPKOvMqpaPoJBpBGTKATEiKdjIoqHZ2b7Clr1NDG7mxDTGYln4SfGJ ykhHAl4GTX3N/egCyl6zUN+cwBkF+mwEPVeNxDmpu7WUPbp2cx2sVIPAKPO98p3K9p1y Nmv/56cW9FpzW+whoOiaMVigiQsq+DImCdEd3+p4fCbZd2VVOSFpgVWEMpXytGegsvqm hYLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GVUmyYuw5MQQkJncH6smJLvmNEJ8m9cu4tEqzvH982s=; b=m2AZm1FWrctGpRIuJSbFTJvfi3KosAG1O1jaGis3U7/IbMf+fQ6w3o2vB/PyV1VJgs ma/TeJaH+MXfWUgZCVaH/oanRpe++tkT2sD07RbUbKScOiEJaQ2suKGjV3OQmgPa1+ki +R3+NYiCPTDpwI0VpFx5lFeKEnTSSjpRVgLLGUyc6kty0S7ZsM+7pCkI4pTKFqUc7ykS gIYOFduZEVQBY4pM9HLzVG44ZTbfMHUtRDRJ5IJE6WWh1YR2aT7NV53MDCjKminKbAlJ xQWzA2J0vyFJJEMg4pJ3dTP3cTx/JCunEPr+ieA+/kVF3L2qtPKEkNqCymL34Xdzl18H rA1g== X-Gm-Message-State: APjAAAUV03vq4FW4lGUlHv+q3MJlMxSXTSKd7x5T62qcnFPWE1ijhq4H gvExLcc1S8MBVhuKEwx55jrTFUagpV2R8sTwOtw= X-Google-Smtp-Source: APXvYqzUv6VpjlbT+oS78oRG7niimrApKiZac5q1w7SATdG67QV0Hrnhho0sLw+HmWMsuidj7u4+soGDWqpirTrnOvE= X-Received: by 2002:a37:9307:: with SMTP id v7mr75678686qkd.495.1564675964901; Thu, 01 Aug 2019 09:12:44 -0700 (PDT) MIME-Version: 1.0 References: <2e50fb67-8a19-412b-19d2-14f5f20b61f8@FreeBSD.org> <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> In-Reply-To: <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> From: Warner Losh Date: Thu, 1 Aug 2019 11:12:33 -0500 Message-ID: Subject: Re: rc script: manual stop vs system shutdown To: "Rodney W. Grimes" Cc: Andriy Gapon , FreeBSD Current , freebsd-rc@freebsd.org X-Rspamd-Queue-Id: 45zwLP5TQKz3Ks5 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=hGXdmzaz; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::729) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.98 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-rc@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[9.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.98)[ip: (-9.33), ipnet: 2607:f8b0::/32(-3.08), asn: 15169(-2.45), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 16:12:46 -0000 On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes < freebsd-rwg@gndrsh.dnsmgr.net> wrote: > > > > Is it possible in an rc script to distinguish between a manual stop > > (e.g., service foo stop) and a stop during a system shutdown (via > > rc.shutdown) ? > > Are there any marker variables for that? > > Or something in the global system state? > > Not that I can think of, but I like this idea, > I am sure that use cases exist. > What is the use case that needs to disambiguate the two cases... Warner > Andriy Gapon > -- > Rod Grimes > rgrimes@freebsd.org > _______________________________________________ > freebsd-rc@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-rc > To unsubscribe, send any mail to "freebsd-rc-unsubscribe@freebsd.org" > From owner-freebsd-rc@freebsd.org Thu Aug 1 17:30:20 2019 Return-Path: Delivered-To: freebsd-rc@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 AA5C4C3317; Thu, 1 Aug 2019 17:30:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zy3t6NKtz3yL8; Thu, 1 Aug 2019 17:30:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x433.google.com with SMTP id u14so34483825pfn.2; Thu, 01 Aug 2019 10:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=QVmpEiXyJZDsTNsowHKZG4ZuugPGXLWRhxu9SdytWO0=; b=rHxvDDvBYkvxdtt6y3BvwaGdy4pTtLgmAoGK8kMCmcEaDMQVzY4B4S1DR7glqHod+Y o7zuG6YyJX5hwGNJM8jJyAPEzORrSBIII4nXMY8FjG6PzyTAdnvZ3hYKn1dE429zaPGo HOF0vxHv/ne6yjI8bbK+IRCXDT7Stz03ppnpkDBCrh00vAYifqizz3rJ/lGgvKnNgzDB 3Thipj4ND7vZUd2aPtFs3uk0sQQB6vAjihYYmfPQWKZJNST2Dquo2TfcUd9Z/mvigXme bkroGGzB3Z5SZjwWiqDShQueBidGuQKoN8wlY6Tr5w5k4fKRsME/p4Z9MEPbgGgbwD9u nHGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=QVmpEiXyJZDsTNsowHKZG4ZuugPGXLWRhxu9SdytWO0=; b=dFAyNjNyTSYSMJQngw3GMgi9JsrvXgb74jjmpzRrxudKdBEvYOui+RKukYApzFhP7k C7wh56GeQO51cnNqH+UlJR29UH/TZDQiLVRL6va9UHjRNkGfU5VDnitevKmLdUZtypFB iMd6QRT1xkushYztCOB8n5Q4N8W47cyviY83/SIm5noh32LRtHTo9UsH46goF74+U+j+ oHAyUyJyi57YIv2aE+Ho7axKd2sjVdEmI9xXFuurnTrqEREnL+TTN46wNMjMktN5J6fs 2EXLeYX83E32ZSbQmIByfP2HoHsjd9elrYQVVDz3/KLjvrupxSjLRFM1m/WKPGKgI0wj cM6g== X-Gm-Message-State: APjAAAWAONk/eg4NRFucsqqmr0uoWabKvMC0RHIFhJ3E1XyePCSNiBzq DdjFJ4OFtWyiP5ihuvYDIGNzsZ1k X-Google-Smtp-Source: APXvYqwYkudLGnwGM/PDGZdo49EMNBLkLRSBEaylk7uXSm1Cnihcj1Po9pd0WZRCWMcrX4KfJHDcHA== X-Received: by 2002:a17:90a:2244:: with SMTP id c62mr10162704pje.29.1564680616733; Thu, 01 Aug 2019 10:30:16 -0700 (PDT) Received: from ?IPv6:2607:fb90:b2e9:8e70:c45f:8832:c431:b7ce? ([2607:fb90:b2e9:8e70:c45f:8832:c431:b7ce]) by smtp.gmail.com with ESMTPSA id n7sm81851258pff.59.2019.08.01.10.30.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 10:30:15 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: rc script: manual stop vs system shutdown From: Enji Cooper X-Mailer: iPhone Mail (16F203) In-Reply-To: <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> Date: Thu, 1 Aug 2019 10:30:14 -0700 Cc: Andriy Gapon , freebsd-rc@freebsd.org, FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> To: "Rodney W. Grimes" X-Rspamd-Queue-Id: 45zy3t6NKtz3yL8 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=rHxvDDvB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::433 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-1.49 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; IP_SCORE(0.00)[ip: (-8.94), ipnet: 2607:f8b0::/32(-3.08), asn: 15169(-2.46), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 17:30:20 -0000 On Aug 1, 2019, at 08:53, Rodney W. Grimes w= rote: >>=20 >> Is it possible in an rc script to distinguish between a manual stop >> (e.g., service foo stop) and a stop during a system shutdown (via >> rc.shutdown) ? >> Are there any marker variables for that? >> Or something in the global system state? >=20 > Not that I can think of, but I like this idea, > I am sure that use cases exist. Have you looked at: keyword: shutdown etc? >> Andriy Gapon > --=20 > Rod Grimes rgrimes@freebsd= .org > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"= From owner-freebsd-rc@freebsd.org Thu Aug 1 17:39:56 2019 Return-Path: Delivered-To: freebsd-rc@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 141A1C37C8; Thu, 1 Aug 2019 17:39:56 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zyGz1FqFz40Gr; Thu, 1 Aug 2019 17:39:54 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x71HdrwU060808; Thu, 1 Aug 2019 10:39:53 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x71Hdrfh060807; Thu, 1 Aug 2019 10:39:53 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908011739.x71Hdrfh060807@gndrsh.dnsmgr.net> Subject: Re: rc script: manual stop vs system shutdown In-Reply-To: To: Enji Cooper Date: Thu, 1 Aug 2019 10:39:53 -0700 (PDT) CC: "Rodney W. Grimes" , Andriy Gapon , freebsd-rc@freebsd.org, FreeBSD Current X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 45zyGz1FqFz40Gr X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.85 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.91)[0.911,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.14), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 17:39:56 -0000 > On Aug 1, 2019, at 08:53, Rodney W. Grimes wrote: > > >> > >> Is it possible in an rc script to distinguish between a manual stop > >> (e.g., service foo stop) and a stop during a system shutdown (via > >> rc.shutdown) ? > >> Are there any marker variables for that? > >> Or something in the global system state? > > > > Not that I can think of, but I like this idea, > > I am sure that use cases exist. > > Have you looked at: > keyword: shutdown > etc? Well that does indeed seem to wipe out my "Not that I can think of". So infact an rc script can tell, it is invoked as: /etc/rc.d/foo shutdown during a system shutdown vs /etc/rc.d/foo stop when invoked by service foo stop? Is that correct? -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-rc@freebsd.org Thu Aug 1 18:08:00 2019 Return-Path: Delivered-To: freebsd-rc@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 D8D8AC438F; Thu, 1 Aug 2019 18:08:00 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zyvN1NFHz424y; Thu, 1 Aug 2019 18:07:59 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pg1-f178.google.com with SMTP id l21so34633957pgm.3; Thu, 01 Aug 2019 11:07:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VrpocGFtw6ur4YD8Zmm6OMng/4lJ8vvQmBokhvTylR0=; b=aDzDTrjQNqxvN94FdREx/6i2lAbqhUdXO8WBS+ViSa3dceHzlbQq/aqeiBdZsE4UUy XH0/88rDxd+MIW/XjQHgSGV0jd1HZF0xN3eCd28BnbkZYjOM82WYtmfe3+mIr7eaatBM +8QB8knL7yUB/WZGyUg8zRrA5STqGTEzrETmlv1+mEPpBts0ysFntbkkjKwOxx2YHGos ogKhQGMdNRHr/ZT7sDghLZvoPB0StzkeGWEpdwPALsV771Z8185BpGNaX/h0S5sQFRbv IFrbCSNz/JqdJZgN53ywAM8oZb2zMvNJz+hLlIBhbiV+ohzAnPbHvpQpVGIapJ80i5gR JIWg== X-Gm-Message-State: APjAAAVBKzNPSgvBsNhM9Q+WzFbcuyOwGRHCivA/KuKdBjjl3WYwLG7I 34aT79VXKzXQGOOTYxS4AJTCC4dY X-Google-Smtp-Source: APXvYqzz9/BSERejN3938qhwR6pRpjc7Q7eQJyAXt93oKNoBWxw7htWYS6p2ddb6Ikr++yGKCRccig== X-Received: by 2002:a17:90a:8591:: with SMTP id m17mr81125pjn.100.1564682878159; Thu, 01 Aug 2019 11:07:58 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-233-136.atc.tvcom.ru. [82.140.233.136]) by smtp.googlemail.com with ESMTPSA id f64sm75937766pfa.115.2019.08.01.11.07.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 11:07:56 -0700 (PDT) Subject: Re: rc script: manual stop vs system shutdown To: Enji Cooper , "Rodney W. Grimes" Cc: freebsd-rc@freebsd.org, FreeBSD Current References: <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Message-ID: <7025ca75-63a0-7916-dd12-4796b0649f01@FreeBSD.org> Date: Thu, 1 Aug 2019 21:07:52 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 45zyvN1NFHz424y X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.215.178 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.05 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; RCVD_IN_DNSWL_NONE(0.00)[178.215.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-3.09)[ip: (-9.55), ipnet: 209.85.128.0/17(-3.41), asn: 15169(-2.46), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[136.233.140.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 18:08:00 -0000 On 01/08/2019 20:30, Enji Cooper wrote: > On Aug 1, 2019, at 08:53, Rodney W. Grimes wrote: > >>> >>> Is it possible in an rc script to distinguish between a manual stop >>> (e.g., service foo stop) and a stop during a system shutdown (via >>> rc.shutdown) ? >>> Are there any marker variables for that? >>> Or something in the global system state? >> >> Not that I can think of, but I like this idea, >> I am sure that use cases exist. > > Have you looked at: > keyword: shutdown > etc? AFAIK, that keyword only controls whether 'foo stop' is called during shutdown or not. -- Andriy Gapon From owner-freebsd-rc@freebsd.org Thu Aug 1 18:08:00 2019 Return-Path: Delivered-To: freebsd-rc@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 B935CC438C; Thu, 1 Aug 2019 18:08:00 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zyvM5WLHz424x; Thu, 1 Aug 2019 18:07:59 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pl1-f181.google.com with SMTP id t14so32537113plr.11; Thu, 01 Aug 2019 11:07:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VrpocGFtw6ur4YD8Zmm6OMng/4lJ8vvQmBokhvTylR0=; b=L7ar9xQZP7ecsQuGC+aPnxVfPq9xzfUHn9lNYe0oS2VuHrJ4L1aD1EOWu9foYxYGyJ 3crCnHzlByGJEkzZOYTnqF6gMnzKjO1O5omC3M/dDhqWr6t84N9vNcvL/lbizhB2Dete gew3ISnOV6H0fsHxviS3WJsad2Lsuk0Mg2kPvyLPy7p2qVRhiSFKlXu6qJhKa6Y8U9O3 HP+/BV2a7wKcRFKy4EGICxOjifRQzZLfe20eKifkJyFYsbSoBLLhxGK4ulT4IZG0u6g8 3miirkikij094j1m8bi+QCukKIAtZQhQEI0Gr35V24WztJHSO0WyfTcGNIcZCJqThnbR B1xA== X-Gm-Message-State: APjAAAWUQQkGS5NsL3dn7T0HF/Uqzcke7w6V9bpsWB5jR8YKRd/dM5B3 1/aCxSWB/yzNefL9aP/8HskcVFnT X-Google-Smtp-Source: APXvYqzBP4MARDQoHm2R9mE6tlcZoksjs/2YnBEyUBpLnh3wJ0df94JCp51nI7jO/e43U73aP8H4VQ== X-Received: by 2002:a17:902:e582:: with SMTP id cl2mr128482128plb.60.1564682877635; Thu, 01 Aug 2019 11:07:57 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-233-136.atc.tvcom.ru. [82.140.233.136]) by smtp.googlemail.com with ESMTPSA id 124sm74704655pfw.142.2019.08.01.11.07.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 11:07:56 -0700 (PDT) Subject: Re: rc script: manual stop vs system shutdown To: Enji Cooper , "Rodney W. Grimes" Cc: freebsd-rc@freebsd.org, FreeBSD Current References: <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Message-ID: <151b0848-0c94-10ad-92db-47c9038e1180@FreeBSD.org> Date: Thu, 1 Aug 2019 21:07:52 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 45zyvM5WLHz424x X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.05 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; RCVD_IN_DNSWL_NONE(0.00)[181.214.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-3.09)[ip: (-9.56), ipnet: 209.85.128.0/17(-3.41), asn: 15169(-2.46), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[136.233.140.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 18:08:00 -0000 On 01/08/2019 20:30, Enji Cooper wrote: > On Aug 1, 2019, at 08:53, Rodney W. Grimes wrote: > >>> >>> Is it possible in an rc script to distinguish between a manual stop >>> (e.g., service foo stop) and a stop during a system shutdown (via >>> rc.shutdown) ? >>> Are there any marker variables for that? >>> Or something in the global system state? >> >> Not that I can think of, but I like this idea, >> I am sure that use cases exist. > > Have you looked at: > keyword: shutdown > etc? AFAIK, that keyword only controls whether 'foo stop' is called during shutdown or not. -- Andriy Gapon From owner-freebsd-rc@freebsd.org Thu Aug 1 18:09:26 2019 Return-Path: Delivered-To: freebsd-rc@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 ABC20C45E3; Thu, 1 Aug 2019 18:09:26 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zyx14fdsz42PY; Thu, 1 Aug 2019 18:09:25 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pl1-f196.google.com with SMTP id m9so32436300pls.8; Thu, 01 Aug 2019 11:09:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0elvBftZxBTl1Qi7kM/W4D6PN8QQaPYCosRxtv0hQn4=; b=YV/71C3coe3xXWfErd0KiPsV3CChIEsGw6TrmB1i5RWeJSqVS1IYZD6+Kd38vRMjXc dqxyzcPF6iS8S/Ecv/bYA9M+Gb8Xig/mLoOlnhCyGHCnJA0otehw2YA2BLIavSCuumpE HLD8a4rW5H1IwFePwFquY3C5dGN+MuBi7KXHRsQxqwatFCHuZSUjIB+/JjeKejmOml1h SggsomUWwSYV82LK0MoF4z3LA1eWLBzR9pFzgdUTP4QNfW986q5L1jPLV8GIfqeuESY9 KR1ZznPCSJ4sS/luNJu/kEBFN9tUArzPAUkf2O5rHE1PmccQPlbIxvNJ+l2ustm3acll 2Hag== X-Gm-Message-State: APjAAAV4xm9J/3id53tyfZchvgL8msRbhX5RHInYcryb6fVoZpAqSCYx INg5LJEKEj2vwZMPiEZgkhthoHXG X-Google-Smtp-Source: APXvYqx4RBig+NCwarQdMq7dGgpjrrGbKmTQ/2blNx19yyWKFig3TdXQqD+GMk3o8bq7xChrLt+sEA== X-Received: by 2002:a17:902:6b02:: with SMTP id o2mr72554199plk.99.1564682963909; Thu, 01 Aug 2019 11:09:23 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-233-136.atc.tvcom.ru. [82.140.233.136]) by smtp.googlemail.com with ESMTPSA id q24sm5401102pjp.14.2019.08.01.11.09.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 11:09:23 -0700 (PDT) Subject: Re: rc script: manual stop vs system shutdown To: "Rodney W. Grimes" , Enji Cooper Cc: freebsd-rc@freebsd.org, FreeBSD Current References: <201908011739.x71Hdrfh060807@gndrsh.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Message-ID: Date: Thu, 1 Aug 2019 21:09:18 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201908011739.x71Hdrfh060807@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 45zyx14fdsz42PY X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.214.196 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; RCVD_IN_DNSWL_NONE(0.00)[196.214.85.209.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_GOOD(0.00)[196.214.85.209.rep.mailspike.net : 127.0.0.18]; IP_SCORE(-1.18)[ipnet: 209.85.128.0/17(-3.41), asn: 15169(-2.46), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[136.233.140.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 18:09:26 -0000 On 01/08/2019 20:39, Rodney W. Grimes wrote: >> On Aug 1, 2019, at 08:53, Rodney W. Grimes wrote: >> >>>> >>>> Is it possible in an rc script to distinguish between a manual stop >>>> (e.g., service foo stop) and a stop during a system shutdown (via >>>> rc.shutdown) ? >>>> Are there any marker variables for that? >>>> Or something in the global system state? >>> >>> Not that I can think of, but I like this idea, >>> I am sure that use cases exist. >> >> Have you looked at: >> keyword: shutdown >> etc? > > Well that does indeed seem to wipe out my > "Not that I can think of". So infact an rc script > can tell, it is invoked as: > > /etc/rc.d/foo shutdown > during a system shutdown > > vs > > /etc/rc.d/foo stop > when invoked by service foo stop? > > Is that correct? > Except there is no 'foo shutdown'. It's foo stop in both cases. To be pedantic, it's foo faststop for shutdown, but that can be manually invoked as well. -- Andriy Gapon From owner-freebsd-rc@freebsd.org Thu Aug 1 18:15:05 2019 Return-Path: Delivered-To: freebsd-rc@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 A8685C4B53; Thu, 1 Aug 2019 18:15:05 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zz3X50wGz432q; Thu, 1 Aug 2019 18:15:04 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pg1-f179.google.com with SMTP id i18so34648905pgl.11; Thu, 01 Aug 2019 11:15:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BjMsJlxiUIDTPlLAttF3YWq1O8W7jhgCF27zaVIFYGc=; b=Tx5VNQX4MrTf1SZ5BRYJlc4GplFDzYO17Gypvld8H2B4PikGpA1V30tFLeWSO7yUIJ fLi94qSi+LYot/UXp3/nMx+K3Zf7ZGZ1OK/MREBa3/E3JpdVBlFsLPsrz/t0oYgE94dg UW6fRnL62GoFQ4XlpB76vLZuPr4VHVJelUHHSc+8+NtHDAUUs9HNt/YRRn66v2a64qcC mp41F/prc6Hb9US53Io/wtVhZS4sKcJvhLZSdQbzmfL+tzMgtb9ZAR07nNyjqyG3FaRd 4Z8Kicls5ze0XdQUZjm3oQ/2z9IXYxkV5145YOu9cVA5yLBLKdU3qGE1/RZ0PqcjeWQy HE4w== X-Gm-Message-State: APjAAAWK9ujCo6T+ObXLxF0y/k/y6Z76AxyI3f2FVui06kO96C7QF9ou ZZWAeZVrhqzdcB0jSRCGuAoTfvTt X-Google-Smtp-Source: APXvYqxm4spgqdFUB454Y7J5yEss2sWwMj2u2r7XEAdioXpWdyjrrcncLYfS55dw77vOajRSajpf3Q== X-Received: by 2002:a17:90a:db42:: with SMTP id u2mr128089pjx.48.1564683302475; Thu, 01 Aug 2019 11:15:02 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-233-136.atc.tvcom.ru. [82.140.233.136]) by smtp.googlemail.com with ESMTPSA id q1sm98384973pfn.178.2019.08.01.11.14.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 11:15:01 -0700 (PDT) Subject: Re: rc script: manual stop vs system shutdown To: Warner Losh , "Rodney W. Grimes" Cc: FreeBSD Current , freebsd-rc@freebsd.org References: <2e50fb67-8a19-412b-19d2-14f5f20b61f8@FreeBSD.org> <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Message-ID: Date: Thu, 1 Aug 2019 21:14:56 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 45zz3X50wGz432q X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.215.179 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.14 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; RCVD_IN_DNSWL_NONE(0.00)[179.215.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-3.14)[ip: (-9.80), ipnet: 209.85.128.0/17(-3.41), asn: 15169(-2.46), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[136.233.140.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 18:15:05 -0000 On 01/08/2019 19:12, Warner Losh wrote: > > > On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes > > > wrote: > > > > > Is it possible in an rc script to distinguish between a manual stop > > (e.g., service foo stop) and a stop during a system shutdown (via > > rc.shutdown) ? > > Are there any marker variables for that? > > Or something in the global system state? > > Not that I can think of, but I like this idea, > I am sure that use cases exist. > > > What is the use case that needs to disambiguate the two cases... I have one use case in mind and it's a truly special case. I want rc.d/watchdogd to gracefully stop watchdogd and to disable the watchdog timer when the stop action is requested manually. And I want it to stop watchdogd and set the watchdog timer to a special shutdown timeout during the shutdown. If the special timeout is configured, of course. -- Andriy Gapon From owner-freebsd-rc@freebsd.org Thu Aug 1 18:53:39 2019 Return-Path: Delivered-To: freebsd-rc@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 B3032C5C49; Thu, 1 Aug 2019 18:53:39 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zzw33LnWz465w; Thu, 1 Aug 2019 18:53:39 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: by mail-lj1-x22b.google.com with SMTP id m8so36825770lji.7; Thu, 01 Aug 2019 11:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6PGNlte3FPx+5IChUgoRkrdcPeksN55rtPuZk3l23ws=; b=XhMZNK7OiWwZvwXQEwr+Q297u79zyxo5lOenkYMThPnfeWHyHJ8nbIxTzoD2bOn5Tx Mrd/1icm86YZNHNKUpMLhw25vZcYUyNgzKPXFgcnOi8TNH3qO6uVvNjCoPeAY4DQmrbz W6FMpANzKRpr2V7GNzQY78KUO9PS+QNGeGjIG4gI32B6e+mKTvdsxKPeYrHJSAUvDqvO TwWQRdLHt5WJbhrORMA0YpaPyqUpJTyWKeY0aJT5rW97vADnJFd/SCaZmhK94B0rwMI4 YIglWGYujGf/G+rt6XeXzRIiU3u33Ydnbiy/e5P/wp6WK84DQLcQPLMNuAbD+Xz0Qxbo znVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6PGNlte3FPx+5IChUgoRkrdcPeksN55rtPuZk3l23ws=; b=qBRLL12lyDBXlvpMQ3VVZxDrjiCcbiOLul+8gSs022+clxKVeot3AN21ND8mjB4qWR UoC9oMvSiu29uMgvS5jPVuGAvjDAVEedFKPvw4WpUZfaH6f0Ot+KyUVafrTsRLZmYP+w OSbqz9kt5yad5ConQ73cvGl8VKV/8WS/e1D9cUdY/DB40hUp/pqd0FiVKfOIYJvxn1ZL 0YCWVGLRYGeZhah49iemE4DF2wjkZkcuDctZEs9rZonQ3JsGQI7Uuk1mIHeNfYi3IRN0 47fOR4KDZiNkeOER7GZ5KpIoiDW2sU0Vdw9IQTo4ltAdOsePKvKOXeqFCbwZvsmrsaFS UHUQ== X-Gm-Message-State: APjAAAXHlYUZPdO3ZTzgb3wqptgfAeWIm/urPoZY1LS3zGvj1bfUQpAy FF7PpV3vvM6WNc97MKaesBxW2+WOvzF00by+9aH4Sw== X-Google-Smtp-Source: APXvYqzeciHlswcecxRR7/fihqEOpZH3/C/oSjRxZl5vo+ogC0/OgqCqxvZ8KbSU7+VikC1yvFN+Gg57eLYPcBq6JW8= X-Received: by 2002:a2e:93c8:: with SMTP id p8mr19587491ljh.6.1564685617222; Thu, 01 Aug 2019 11:53:37 -0700 (PDT) MIME-Version: 1.0 References: <2e50fb67-8a19-412b-19d2-14f5f20b61f8@FreeBSD.org> <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> In-Reply-To: From: Freddie Cash Date: Thu, 1 Aug 2019 11:53:25 -0700 Message-ID: Subject: Re: rc script: manual stop vs system shutdown To: Andriy Gapon Cc: Warner Losh , "Rodney W. Grimes" , FreeBSD-Current , freebsd-rc@freebsd.org X-Rspamd-Queue-Id: 45zzw33LnWz465w X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 18:53:39 -0000 On Thu, Aug 1, 2019, 11:15 AM Andriy Gapon, wrote: > On 01/08/2019 19:12, Warner Losh wrote: > > > > > > On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes > > > > > wrote: > > > > > > > > Is it possible in an rc script to distinguish between a manual stop > > > (e.g., service foo stop) and a stop during a system shutdown (via > > > rc.shutdown) ? > > > Are there any marker variables for that? > > > Or something in the global system state? > > > > Not that I can think of, but I like this idea, > > I am sure that use cases exist. > > > > > > What is the use case that needs to disambiguate the two cases... > > I have one use case in mind and it's a truly special case. > I want rc.d/watchdogd to gracefully stop watchdogd and to disable the > watchdog timer when the stop action is requested manually. And I want > it to stop watchdogd and set the watchdog timer to a special shutdown > timeout during the shutdown. If the special timeout is configured, of > course. > A horribly hackish workaround could be to do a "pgrep shutdown" and "pgrep reboot" and "pgrep halt" in the stop function of the RC script. If one of those those processes exist, then a system shutdown/reboot is in progress. Not elegant, but could be workable until something nicer is added. Cheers, Freddie Typos courtesy of my phone's keyboard. > From owner-freebsd-rc@freebsd.org Thu Aug 1 19:37:51 2019 Return-Path: Delivered-To: freebsd-rc@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 64D60C7513; Thu, 1 Aug 2019 19:37:51 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4600v249wtz4BY5; Thu, 1 Aug 2019 19:37:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pg1-f193.google.com with SMTP id n9so28531616pgc.1; Thu, 01 Aug 2019 12:37:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Srl/YOJaNfbL/Koo4yB41YY3eYUoGc6UzuH3efggz+U=; b=YZ19b7tgkn95fhBqvSIaGYUvdYqEXtgv4TtugKo1UwuaErOV2QoPCYi4SdBlMf8BF/ OA880j1Q6UoSMFB5xiUrCCisWFnNcZFHTr3nPUPmllSs0amo04MMKjAZsSr1v46FLeug HfyhNpQP4YH7B7GB8+JNi0eRL1ylNeYr3RKmB6rvEWqKpysVXBvEDeQA5QsArG001hpG RCOZFt1OG/pGS7S7A56i55pwdOiMvwHpfAFiz+u+Xjo3GB8bZYwwmn2AToLTbvJyjhah TP4lpUB/YCiOqmZSrnYMyQqHEnSrlgBYm57iuAKSiDL31AZpJzUAOn3k+/doDFaQVCQr B01A== X-Gm-Message-State: APjAAAWHqo7CcQyBJU6WeGZ355oRF145/3x7mBdYutUzx5fX0f+0174h j+iM8z6BWAB9IQ1/Zp0E4AEsoGUm X-Google-Smtp-Source: APXvYqw4AsV0iQiVR8jSMmIcAGeVe9RbEIhGj1g0JCl1scNrm982O7up3Vl6GZZ/yIykI43Sqa8IVQ== X-Received: by 2002:a63:61cf:: with SMTP id v198mr4438108pgb.217.1564688268417; Thu, 01 Aug 2019 12:37:48 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-233-136.atc.tvcom.ru. [82.140.233.136]) by smtp.googlemail.com with ESMTPSA id t7sm71027561pfh.101.2019.08.01.12.37.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 12:37:47 -0700 (PDT) Subject: Re: rc script: manual stop vs system shutdown To: Freddie Cash Cc: Warner Losh , "Rodney W. Grimes" , FreeBSD-Current , freebsd-rc@freebsd.org References: <2e50fb67-8a19-412b-19d2-14f5f20b61f8@FreeBSD.org> <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Message-ID: <9b9ca0a6-5aee-74c7-2ac0-a70a81d72593@FreeBSD.org> Date: Thu, 1 Aug 2019 22:37:42 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4600v249wtz4BY5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.215.193 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.15 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; RWL_MAILSPIKE_GOOD(0.00)[193.215.85.209.rep.mailspike.net : 127.0.0.18]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; RCVD_IN_DNSWL_NONE(0.00)[193.215.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.18)[ipnet: 209.85.128.0/17(-3.40), asn: 15169(-2.46), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[136.233.140.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 19:37:51 -0000 On 01/08/2019 21:53, Freddie Cash wrote: > On Thu, Aug 1, 2019, 11:15 AM Andriy Gapon, > wrote: > > On 01/08/2019 19:12, Warner Losh wrote: > > > > > > On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes > > > >> > > wrote: > > > >     > > >     > Is it possible in an rc script to distinguish between a > manual stop > >     > (e.g., service foo stop) and a stop during a system shutdown > (via > >     > rc.shutdown) ? > >     > Are there any marker variables for that? > >     > Or something in the global system state? > > > >     Not that I can think of, but I like this idea, > >     I am sure that use cases exist. > > > > > > What is the use case that needs to disambiguate the two cases... > > I have one use case in mind and it's a truly special case. > I want rc.d/watchdogd to gracefully stop watchdogd and to disable the > watchdog timer when the stop action is requested manually.  And I want > it to stop watchdogd and set the watchdog timer to a special shutdown > timeout during the shutdown.  If the special timeout is configured, of > course. > > > A horribly hackish workaround could be to do a "pgrep shutdown" and > "pgrep reboot" and "pgrep halt" in the stop function of the RC script. > If one of those those processes exist, then a system shutdown/reboot is > in progress. > > Not elegant, but could be workable until something nicer is added. I think that shutdown by default sends a signal to init and exits. It's init that kicks off rc.shutdown. -- Andriy Gapon From owner-freebsd-rc@freebsd.org Thu Aug 1 19:51:34 2019 Return-Path: Delivered-To: freebsd-rc@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 EF8E5C7A87 for ; Thu, 1 Aug 2019 19:51:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4601Bt24mHz4CXW for ; Thu, 1 Aug 2019 19:51:34 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1564689092; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Ms4CIqMtkP6h0tASsO/VonD58pJl2TjPUjSwcK8rZ+POmM8I5WZK8NuD96QLJHDKzIhMaGfo2kiX0 F02ZTD787aTumFzFXTkc1QdTpYHfy8m4YfNCqG3CrXua/ngv0OhKgOhXI6chwfSwcza4U0AdLGgW+x xYDwmZT7+KrjN/HEkYYfKis/ArzlKssZfk1JG28P+ieRcuseY6l4ca2AqZXE8zm8Y5lGEC0+V3NoAQ JX8/3wSCt5wkMtzj1VdQcLdh9qXcmYkEmv3A88uYQFAf9JIDCT6dd85M7j8LFzUy14h5e4ERbSPOzf s5m+2G882pJTfDebR0GZCPju3pNAdDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=85Lgl8FM91YG0R0BgewouW+m+///IS1ZVE9iEQTHeSE=; b=uevI/iw+DsB6Kiu6DNWjlX5YYBS7BfR8W+rRgrBtN5EbybDmcGT6nMZbLAYF+uQIQjP17c6ONx0ys Rw4YJZmnUeokoYuIMJ/Zo43bsMBjc7jGfAQEYgbtWQdKVZzvzcHDy3ExTraSzz5vgd3vcWIgGK4ma7 LVTEN/MEZizLOU189vCeduMCRzM39kxeaLL3gBBTwdZRES79JlKL752YQfhINbiGZeHSudvUEE3y9V wKz4Mo05FXxGJMB5GMrT3mN6J3EFp5AE1CpPPrInl4DyQdJG5dIV1euk3zd+XRNR+IFRShfhN+VPCr cA9CR9Rju5I4I7+JfwvSFG5aF2MXp2g== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=85Lgl8FM91YG0R0BgewouW+m+///IS1ZVE9iEQTHeSE=; b=Th0hFjUeOa6o2/i98iPcp40oyy7Cw4dnuj8hkNTzvyS+fzG6SgdIKon0Kj124AP1bXZg0lJSlOLty 0A4Dzw/DUh3vbjovxIO953hi8rz6mE8IWPZQ0o6Kfr12eJ8npMOJxWRjcSU9yLDGa5rdWN6roVOEd5 HL2cNBAu7F2FXJTIaMIVRAO7OmTKNhIMxP2E8mclpeMI/tPeATo2uNCvcp70mGdvRHprw6UO3bJ2d6 e/68DUlpICGObcA7XXLtq6LxfP5H8li1GmZwQB5GYRhoWykm5QN7pk1RHqVtwvhRApPTDIDphrN9to AaGTG27rmH0wPLGb5kBsj1eR15kc+xQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: c13014c6-b495-11e9-85ec-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id c13014c6-b495-11e9-85ec-13b9aae3a1d2; Thu, 01 Aug 2019 19:51:31 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x71JpT22002721; Thu, 1 Aug 2019 13:51:29 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: rc script: manual stop vs system shutdown From: Ian Lepore To: Andriy Gapon , Warner Losh , "Rodney W. Grimes" Cc: FreeBSD Current , freebsd-rc@freebsd.org Date: Thu, 01 Aug 2019 13:51:29 -0600 In-Reply-To: References: <2e50fb67-8a19-412b-19d2-14f5f20b61f8@FreeBSD.org> <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4601Bt24mHz4CXW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.71 / 15.00]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.71)[-0.715,0] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 19:51:35 -0000 On Thu, 2019-08-01 at 21:14 +0300, Andriy Gapon wrote: > On 01/08/2019 19:12, Warner Losh wrote: > > > > > > On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes > > > > > wrote: > > > > > > > > Is it possible in an rc script to distinguish between a manual stop > > > (e.g., service foo stop) and a stop during a system shutdown (via > > > rc.shutdown) ? > > > Are there any marker variables for that? > > > Or something in the global system state? > > > > Not that I can think of, but I like this idea, > > I am sure that use cases exist. > > > > > > What is the use case that needs to disambiguate the two cases... > > I have one use case in mind and it's a truly special case. > I want rc.d/watchdogd to gracefully stop watchdogd and to disable the > watchdog timer when the stop action is requested manually. And I want > it to stop watchdogd and set the watchdog timer to a special shutdown > timeout during the shutdown. If the special timeout is configured, of > course. > The shutdown timeout is already supported: you just set '-x ' in watchdogd_flags in rc.conf; no changes to the rc.d script needed. I think probably you don't even need the first part of what you want. The -x arg covers you in the reboot case; most people probably won't use it. But if you are using it, and you want to truly kill the dog, you would just do "watchdog -t 0" after "service watchdogd stop". If you really felt the need to cover that with a single service command, then how about using "service watchdogd cancel" where the cancel verb does the -t 0 after killing the daemon? -- Ian From owner-freebsd-rc@freebsd.org Thu Aug 1 22:51:30 2019 Return-Path: Delivered-To: freebsd-rc@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 0D16DA3784; Thu, 1 Aug 2019 22:51:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4605BT1cFwz4Lhx; Thu, 1 Aug 2019 22:51:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x530.google.com with SMTP id x15so24648179pgg.8; Thu, 01 Aug 2019 15:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=n2hE07ygI2a56yanpCadZcXFnDPIGOJWjyrgTGnnJU8=; b=hlj8PbolhZEQieE3DMFQqubFo6Sqn9vyVZvS0nrpm+BZzvx9PNYayCV8nm0nfyPE3C aF7O/l2jVyc4YidXlf49XXUv1fW9ixIvTFf6+iLUGLlXAEMQ39scxbwQwog/9Bm1G57O BMu22uxmNzBVscJBQZf7FnP1hlku5iQaHfoBsZHA5eCyp1+N1VRQ9ouyv3HPNOW7jDoA cvkpQSFiuCap23L5JboJwkqNXEA+cvAUoBqUnqNv3G9Lo5YJulOb1IHiea/u+cB68pmv /dm0YqX6tj0f0plYrjdI65usYXRtYildSxscJg9fGJRPozmCBCAb2SfeO4oO3ydj/pQu Yyjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=n2hE07ygI2a56yanpCadZcXFnDPIGOJWjyrgTGnnJU8=; b=JmPUo5W1rO3piHC+c1+RUiUGk5v4QHJwajIRVnKUEWeT/M00IGZFWhx3bCgJ80QIRO 90abeiDi9j/K1pF1pA5UB6ZcK3VzYGa4tECNG+NYoHD4BHCU2odEQ2xe8830rAFos5Wo nS1boIhFAosZ2Jzz173hb2rye4DyLko+OLCcMsZGX2ipRAu4yRGUfbp6YJzNKKheSb21 judwwtgAeHDg+WjEJ9uSJs5jKjYsj2tvemdcMQSwou0oVIveBRzFsrTbCiiLr91Bja0M PgPVW1g8vbn8H7WYGFBUN6jN5Yp0v/pA4vv5msfHBg6cLbd9h4XZiJn/Ka7Od3rLRz9c NXeg== X-Gm-Message-State: APjAAAUYMmGOscQJ14VVn6kx61wQwYqpZC8cDqKPZAD4VFTMU6s4Rh+g YHjGQweO6YtDcG9YXceZXFY= X-Google-Smtp-Source: APXvYqzPRmjTg4S+GLHvK/T0A8tkQTu5Yp6WGbYcVnH4a6Y9cjBTn4bZh2RpXm9YRVPEYtZeBpfcng== X-Received: by 2002:a17:90a:db44:: with SMTP id u4mr1166370pjx.52.1564699887245; Thu, 01 Aug 2019 15:51:27 -0700 (PDT) Received: from ?IPv6:2607:fb90:b2e9:8e70:c45f:8832:c431:b7ce? ([2607:fb90:b2e9:8e70:c45f:8832:c431:b7ce]) by smtp.gmail.com with ESMTPSA id f15sm59607736pgu.2.2019.08.01.15.51.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 15:51:26 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: rc script: manual stop vs system shutdown From: Enji Cooper X-Mailer: iPhone Mail (16F203) In-Reply-To: <151b0848-0c94-10ad-92db-47c9038e1180@FreeBSD.org> Date: Thu, 1 Aug 2019 15:51:25 -0700 Cc: "Rodney W. Grimes" , freebsd-rc@freebsd.org, FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: <9A2B3CD5-3F67-4268-AB54-C7991CA1BD66@gmail.com> References: <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> <151b0848-0c94-10ad-92db-47c9038e1180@FreeBSD.org> To: Andriy Gapon X-Rspamd-Queue-Id: 4605BT1cFwz4Lhx X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=hlj8Pbol; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::530 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-0.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[0.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (-9.30), ipnet: 2607:f8b0::/32(-3.09), asn: 15169(-2.46), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 22:51:30 -0000 > On Aug 1, 2019, at 11:07, Andriy Gapon wrote: >=20 >> On 01/08/2019 20:30, Enji Cooper wrote: >> On Aug 1, 2019, at 08:53, Rodney W. Grimes wrote: >>=20 >>>>=20 >>>> Is it possible in an rc script to distinguish between a manual stop >>>> (e.g., service foo stop) and a stop during a system shutdown (via >>>> rc.shutdown) ? >>>> Are there any marker variables for that? >>>> Or something in the global system state? >>>=20 >>> Not that I can think of, but I like this idea, >>> I am sure that use cases exist. >>=20 >> Have you looked at: >> keyword: shutdown >> etc? >=20 > AFAIK, that keyword only controls whether 'foo stop' is called during > shutdown or not. This is correct. The other implemented keyword is =E2=80=98nostart=E2=80=99 (iirc). The two i= n tandem would likely fit your need, minus someone manually starting a scrip= t. -Enji= From owner-freebsd-rc@freebsd.org Fri Aug 2 06:39:25 2019 Return-Path: Delivered-To: freebsd-rc@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 03038AB746; Fri, 2 Aug 2019 06:39:25 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 460HZN0sbcz3DbJ; Fri, 2 Aug 2019 06:39:23 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pl1-f180.google.com with SMTP id y8so33266819plr.12; Thu, 01 Aug 2019 23:39:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kOZHJ7m78tve+XrmKvoHySm6E3aS00q5Hk3ogXE+ZHY=; b=W3cBpFBM6k0xM7ZStWIy1QeUXMFyrckXlYWf7zT6Kldf03uLaU9yNn/bREU73ueV/q 7FhuyUWsSIL4o0YzGBTdWv45XthOdOx68TofL9jCaKePlyIbDF3nzaUWZn6hJuTqgFRu adZlYNfNmVIpbKmCXMSnhg5hiaqUdGRoFTUQVm/gzAmfP31iKYKkpz5HhMV3UQBsAE/7 nfnV2H92D+nVCXQ7DyAeNJ6LG4n6uIOCE2yMCmHuQwIaygFCVDb5OWcxXKTx9qHsdr4u RLrzFZ983mJmLVWSUUaHmULmroBcVCqLx8CPlCpBN/iIRt9UEEHbVzvj31RAyldKP/6H 0z4w== X-Gm-Message-State: APjAAAV6292JtQexDSqhKUkqJOQXTK+wxAA837+TMYD5arnarkwGFnCs hAQzRIyVMom8Lh8YLQ4yZ1qkk9ht X-Google-Smtp-Source: APXvYqwLAHLhJIZKjeT4ZsekImoq9vFZG9lO4W+8RKcDSTktvc6VSzI0M8vgbfJTr1tQXehqLHtWDg== X-Received: by 2002:a17:902:1004:: with SMTP id b4mr132017837pla.325.1564727961979; Thu, 01 Aug 2019 23:39:21 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-233-136.atc.tvcom.ru. [82.140.233.136]) by smtp.googlemail.com with ESMTPSA id 81sm69120572pfa.86.2019.08.01.23.39.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 23:39:20 -0700 (PDT) Subject: Re: rc script: manual stop vs system shutdown To: Enji Cooper Cc: "Rodney W. Grimes" , freebsd-rc@freebsd.org, FreeBSD Current References: <201908011553.x71FrTCd060252@gndrsh.dnsmgr.net> <151b0848-0c94-10ad-92db-47c9038e1180@FreeBSD.org> <9A2B3CD5-3F67-4268-AB54-C7991CA1BD66@gmail.com> From: Andriy Gapon Openpgp: preference=signencrypt Message-ID: <04e52315-4541-991d-1f12-b0fb030e6594@FreeBSD.org> Date: Fri, 2 Aug 2019 09:39:15 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <9A2B3CD5-3F67-4268-AB54-C7991CA1BD66@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 460HZN0sbcz3DbJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.11 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; RCVD_IN_DNSWL_NONE(0.00)[180.214.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-3.13)[ip: (-9.76), ipnet: 209.85.128.0/17(-3.40), asn: 15169(-2.46), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[136.233.140.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2019 06:39:25 -0000 On 02/08/2019 01:51, Enji Cooper wrote: > >> On Aug 1, 2019, at 11:07, Andriy Gapon wrote: >> >>> On 01/08/2019 20:30, Enji Cooper wrote: >>> On Aug 1, 2019, at 08:53, Rodney W. Grimes wrote: >>> >>>>> >>>>> Is it possible in an rc script to distinguish between a manual stop >>>>> (e.g., service foo stop) and a stop during a system shutdown (via >>>>> rc.shutdown) ? >>>>> Are there any marker variables for that? >>>>> Or something in the global system state? >>>> >>>> Not that I can think of, but I like this idea, >>>> I am sure that use cases exist. >>> >>> Have you looked at: >>> keyword: shutdown >>> etc? >> >> AFAIK, that keyword only controls whether 'foo stop' is called during >> shutdown or not. > > This is correct. > > The other implemented keyword is ‘nostart’ (iirc). The two in tandem would likely fit your need, minus someone manually starting a script. They won't, in my opinion. Not sure if the misunderstanding is on my part or yours. -- Andriy Gapon