From owner-freebsd-questions@freebsd.org Tue Apr 23 23:13:40 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 599371585833 for ; Tue, 23 Apr 2019 23:13:40 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 D50618F7E6 for ; Tue, 23 Apr 2019 23:13:39 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wr1-x435.google.com with SMTP id t17so10611316wrr.4 for ; Tue, 23 Apr 2019 16:13:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AeZwOCuLvB5MpsaLKYs7lGJVKuWBrYFt/U/1oVH0zfc=; b=PHbhuwky1ZC1KfcesuzrohcTuJ6DYCOl8ZkOMa2kbiuYtx/qSQwj7EuhEu0qDCO2ch +3nqvHyIQljNrq2pYjXTdh/J91/BI59x4o6E7hXnbY3FSBZ7qneSWPTdTUijt49ys08h zAim/+qPkVpJQKoLVnMfVq+wXZSbBfn8S1CX0zgF1pQzwnTbEgWyAbUUT0B10pw0h8MJ YEEz6HnjuWVZ6sRgoBEBvbHRdh0PVwl4Los2bGsAQIqgMGq1J3qXQocdrwAT5vk0tLW9 XGZVLHvpMSQn+et3AUidZ+z7Ew2jD2VaNYjrQw6kjmN3Ozm0bluJyPQbIGzYYwWGXZh8 XGoA== X-Gm-Message-State: APjAAAX4h/5YIH6M26K56lMyLzulp5lH5hN20E9ZYuUw8oVwpacgtRrM FLSEMDZRDqmfr3TIVNqgyO+k8LObfss= X-Google-Smtp-Source: APXvYqwaKBotcm82seItMJa/oTC534YI5HLeo4gW0AoTijSAKlrXO3ndT9fcRnAF7VU6Bb4rsfiz6Q== X-Received: by 2002:adf:de0f:: with SMTP id b15mr18018587wrm.308.1556061218362; Tue, 23 Apr 2019 16:13:38 -0700 (PDT) Received: from gumby.homeunix.com ([90.205.254.84]) by smtp.gmail.com with ESMTPSA id b8sm11757208wrf.21.2019.04.23.16.13.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 16:13:37 -0700 (PDT) Date: Wed, 24 Apr 2019 00:13:32 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: rcorder, script to be executed last? Message-ID: <20190424001332.6c39097d@gumby.homeunix.com> In-Reply-To: <20190423031127.GA2158@admin.sibptus.ru> References: <20190423031127.GA2158@admin.sibptus.ru> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D50618F7E6 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.995,0] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 23:13:40 -0000 On Tue, 23 Apr 2019 10:11:27 +0700 Victor Sudakov wrote: > Dear Colleagues, > > How do I create a rc.d script which would be guaranteed to execute > last (after all other scripts) on system shutdown? Having something like this at the top of the file should do it # PROVIDE: killpower # BEFORE: growfs sysctl swap fsck # KEYWORD: nojail shutdown There's no absolute guarantee that this wont be obsoleted, but the chances of all four scripts in the BEFORE line going away, or anything being added that significantly erodes the 10 second power-down delay, are small. I'm assuming here that "apcupcd --killpower" can be run that late in the shutdown and doesn't rely on anything that's already been shut down by an rc script.