XPost: uk.comp.os.linux   
   From: theom+news@chiark.greenend.org.uk   
      
   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&manpa   
   h=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.   
      
   This is the source to the FreeBSD version:   
   https://github.com/freebsd/freebsd-src/tree/main/usr.sbin/daemon   
      
   - maybe the 'sighup' feature could be merged into the Debian version?   
      
   Theo   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|