Path: csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Dan Purgert Newsgroups: uk.comp.os.linux,alt.os.linux.ubuntu Subject: Re: daemon program? Date: Wed, 10 Sep 2025 10:54:07 -0000 (UTC) Organization: A noiseless patient Spider Lines: 55 Message-ID: References: <109bdsh$1kas0$1@dont-email.me> <109rb8b$1i7fe$1@dont-email.me> <109rfs8$1iu6u$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 10 Sep 2025 10:54:08 +0000 (UTC) Injection-Info: dont-email.me; posting-host="107eb23290955f21700a2a789ca1c31a"; logging-data="1725312"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EYvQ8tIN7Ln2/MJyvk7MfMt6OPYrgDUU=" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:RSKceyKsVJ/xJlK9XiXx/sRstKc= Xref: csiph.com uk.comp.os.linux:23733 alt.os.linux.ubuntu:212308 On 2025-09-10, Theo wrote: > In uk.comp.os.linux Dan Purgert wrote: >> On 2025-09-10, Mike Scott wrote: >> > On 10/09/2025 09:42, Dan Purgert wrote: >> >> On 2025-09-10, Mike Scott wrote: >> >>> On 04/09/2025 08:26, Richard Kettlewell wrote: >> >>>> Mike Scott> >>> ottsonline.org.uk.invalid> writes: >> >>>>> I've been using a program 'daemon' on freebsd >> >>>>> (eg >> >>>>> man.freebsd.org/cgi/man.cgi?query=daemon&sektion=8&manpath=FreeBSD+14.3-RELEASE+and+Ports) >> >>>>> >> >>>>> which will run arbitrary programs as daemons, handling all the >> >>>>> necessary "house-keeping" for them. >> >>>>> >> >>>>> I can't find a ready-to-roll linux version - is there one please? >> >>>> If you want an (almost) identical interface then in Debian (and >> >>>> presumably therefore also Ubuntu), there’s a command of the same name >> >>>> and similar behavior: >> >>>> >> >>>> https://manpages.debian.org/trixie/daemon/daemon.1.en.html >> >>> >> >>> Sorry, back again. >> >>> >> >>> I've been playing with this and there seems to be an important feature >> >>> missing on linux that's in the BSD version: how to do logfile rotation? >> >>> [...] >> >>> Have I missed something? >> >> >> >> logrotate(8) ? >> >> >> >> >> > Thanks for the reply, but no. That assumes the existence of the >> > mechanism missing AFAICS from this daemon. >> >> I'm not sure what you mean here. "Logrotate" is a tool that exists. >> >> Granted, the systems here have been getting in-place upgrades for the >> last decade; maybe logrotate has since been replaced in 'clean' installs >> (or it's not a default part of the installation and I've just completely >> forgotten that). > > It sounds like the problem is that 'daemon' is never closing the output > file, so 'logrotate' is never able to process it. The -H flag is supposed > to tell daemon to close the file on SIGHUP so logrotate can swap it > out, but it doesn't exist in the Debian version. Oh, then you add 'copytruncate' to the rotate directives, and the original log gets zeroed out when logrotate runs. -- |_|O|_| |_|_|O| Github: https://github.com/dpurgert |O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860