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