Re: cron @shutdown

Xin Li <[email protected]>
Newsgroups gmane.os.freebsd.architechture
Organization The FreeBSD Project
Message-ID <[email protected]>

On 8/2/22 08:02, Cy Schubert wrote:
> In message <[email protected]
> om>
> , Warner Losh writes:
>> --000000000000543e5405e5435396
>> Content-Type: text/plain; charset="UTF-8"
>>
>> On Tue, Aug 2, 2022, 8:54 AM Cy Schubert <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Does anyone think there might be some utility with an @shutdown crontab(5)
>>> "nickname" similar to @reboot but instead when cron shuts down?
>>>
>>> I pointed out to one of my customers that @reboot might be an option
>>> instead of an rc script (or in his case a systemd unit file). Not that an
>>> @reboot for FreeBSD cron would contribute to solving his Linux problem but
>>> might our users be interested in something like this?
>>>
>>
>>
>> If it's simple and increases portability, I'm all for it.
> 
> It's simple but there's no Linux equivalent, yet. My thoughts are to
> implement in FreeBSD then canvas then submit a pull request to the Linux
> Vixie Cron maintainer and discuss with the various Linux vendors.

I think it would be worth updating our cron with OpenBSD's cron(8) or a 
newer vixie-cron version first.  There are a lot of improvements that 
would be useful for us too.

Regarding @shutdown, I'd second Warner that if it's simple to implement, 
we should have it.  However, we should also keep in mind that delaying 
shutdown can be bad as eventually the shutdown process would send 
SIGKILL to everyone, and the timer starts before cron receives SIGTERM. 
  So the user *might* want their software to be more robust with crashes 
and developers should focus more on how to make the software to recover 
quickly from a crash, because crash can not be avoided: hardware issue, 
user sending SIGKILL, bugs, etc. can all cause it to crash. On the other 
hand, making too much effort with how to "properly" shutdown generally 
makes the situation worse, and sometimes they don't contribute to a 
better stop-to-start-and-ready-to-use time compared to a 
crash-only-with-fast-recovery design, so while it can be really useful 
for some scenarios, it's probably not the best thing that the user 
should do.

Cheers,
OpenPGP_0xE76E2D1168D7CB05.asc (application/pgp-keys, 3.1 KB)
-----BEGIN PGP PUBLIC KEY BLOCK-----

xsFNBFobtgEBEAC0Q9xkugo7ZVc1sk7RHX8yUv/4XXrlvWpoJvgKqLuSK1QYLSXS
E8BtTSq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+4XyYnHLS+uRieMNr6lgQE/+Ev1hJxlcczv/
ABEBAAHCwXwEGAEKACYWIQSiT511etYoZ/Ayoannbi0RaNfLBQUCWhu2AQIbDAUJ
CZbJAAAKCRDnbi0RaNfLBbnQEACtXAz8ZXrIr3SWAZS8xJ5OCsQ+8WfpCTgzamdC
662L70P47TnPYhNQBj1HPFLSFQugnwkLzBRjwyxuPA5a9w11GtGU6NwRB0JHO+ng
OTQ/IDWyKH3A/eJdTzJtpJmTZhlAwbNV7sqZs43MqGNaiT3xfLE39EWvDPImdCuD
0QHAYGTS3ZCr5HPRNlyQIJ4s1mB3c5XWt1R864aRAOUwYMYLuX09LIihn04/qIU8
J4Y4zL1Fbn46Yk5St0cBiJPZ758T0jiY76f6nHjeCtOTIHJKUcDEo0AQ8n7g5hP/
Y6s+vmQ1aFSF4YO8Hwjp9gnpksJfJEWxUTj/sQ6XsiEOSm1gRste2U0iu7UCjYkj
ejfMW0XhH+W9XEF5fgaJtp5/zZYksFfn+w4s6X34uMOcCWfPVpnQ8B0Gh0l7pOj6
K8VGEfR6OQohEjoijrG3UU9rYa5rq4V0WD+5BzizsPKC69OgsFAIhXO/hpQxcUd9
TVg6or+qC1tvHxJNG/uRuDhJtdrEjmTybxBEddxqHSZK87TGpE2dhHzhQlzIl9XY
eUk7X17bhmbzPJq39BAqBdqfYsDm560vX9DEAlxfMbOrcgrr3CY/1Kkbe8g0btka
CjJmfYbkO0IblFa5N2xGet14AZfXcOtaS2xFWiTkqUeptIM2jPJ5OuuYIG997vjt
gApnMg==
=9XGL
-----END PGP PUBLIC KEY BLOCK-----
OpenPGP_signature (application/pgp-signature, 840 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.