From: andrew@bower.uk   
      
   Source: daemontools   
   Version: 1:0.76-15   
   Severity: wishlist   
   Tags: patch   
   X-Debbugs-Cc: runit@packages.debian.org   
      
   Dear Maintainer,   
      
   The daemontools-inspired family of supervision suites typically share the   
   ability to emulate some subset of the daemontools tools with compatible   
   behaviour.   
      
   For example, chpst from runit can emulate envdir, envuidgid, pgrphack, setlock,   
   setuidgid and softlimit.   
      
   Similarly, run scripts for daemons using these suites, if they don't take   
   advantage of features unique to those suites, may be compatible between them.   
      
   In practice, that compatibility is limited because of features included in   
   distributions, such as runit service directories in Debian typically using   
   /usr/lib/runit/invoke-run to perform some standard actions. However, third   
   party-provided service directories especially may well stick to the basics. The   
   debian package 'publicfile' is compatible with daemontools and runit   
   supervision.   
      
   Ideally someone writing a run script that only needed the behaviour of   
   'setlock' would simply call 'setlock', for example. However, that would   
   mean unnecessarily depending on the daemontools package when your   
   service might be running with runit that already has 'chpst' installed,   
   and so will be written to use 'chpst -l' instead.   
      
   We can fix this by installing all the common tools using the Debian   
   'alternatives' mechanism. This is very lightweight - symlink traversal is   
   extremely cheap in Linux.   
      
   I attach a patch for daemontools that does this. For simplicitly it groups   
   together all the tools that 'chpst' can emulate (headlined by the 'envdir'   
   tool), but theses could be split into a different alternative for each tool if   
   one wanted that granularity. An additional group just contains 'fghack', which   
   my 'xchpst' tool can also emulate.   
      
   I also attach example patches for the 'runit' and 'xchpst' packages to show how   
   this could work.   
      
   Here is some example output:   
      
    # sudo update-alternatives --config daemontools   
    There are 3 choices for the alternative daemontools (providing   
   /usr/bin/envdir).   
      
    Selection Path Priority Status   
    ------------------------------------------------------------   
    0 /usr/bin/envdir.djb 50 auto mode   
    1 /usr/bin/chpst 30 manual mode   
    2 /usr/bin/envdir.djb 50 manual mode   
    * 3 /usr/bin/xchpst 40 manual mode   
      
    Press to keep the current choice[*], or type selection number: 1   
    update-alternatives: using /usr/bin/chpst to provide /usr/bin/envdir   
   (daemontools) in manual mode   
      
   The presence of alternatives will also help developers trying to compare   
   behaviours across different toolsets.   
      
   What do you think about this idea?   
      
   Andrew   
      
   -- System Information:   
   Debian Release: forky/sid   
    APT prefers unstable   
    APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')   
   Architecture: amd64 (x86_64)   
   Foreign Architectures: i386   
      
   Kernel: Linux 6.18.9+deb14-amd64 (SMP w/24 CPU threads; PREEMPT)   
   Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),    
   ANGUAGE=en_GB:en   
   Shell: /bin/sh linked to /usr/bin/dash   
   Init: sysvinit (via /sbin/init)   
   LSM: AppArmor: enabled   
      
   diff --git a/debian/daemontools-man/envdir.8 b/debian/daemontool   
   -man/envdir.djb.8   
   similarity index 100%   
   rename from debian/daemontools-man/envdir.8   
   rename to debian/daemontools-man/envdir.djb.8   
   diff --git a/debian/daemontools-man/envuidgid.8 b/debian/daemont   
   ols-man/envuidgid.djb.8   
   similarity index 100%   
   rename from debian/daemontools-man/envuidgid.8   
   rename to debian/daemontools-man/envuidgid.djb.8   
   diff --git a/debian/daemontools-man/fghack.8 b/debian/daemontool   
   -man/fghack.djb.8   
   similarity index 100%   
   rename from debian/daemontools-man/fghack.8   
   rename to debian/daemontools-man/fghack.djb.8   
   diff --git a/debian/daemontools-man/pgrphack.8 b/debian/daemonto   
   ls-man/pgrphack.djb.8   
   similarity index 100%   
   rename from debian/daemontools-man/pgrphack.8   
   rename to debian/daemontools-man/pgrphack.djb.8   
   diff --git a/debian/daemontools-man/setlock.8 b/debian/daemontoo   
   s-man/setlock.djb.8   
   similarity index 100%   
   rename from debian/daemontools-man/setlock.8   
   rename to debian/daemontools-man/setlock.djb.8   
   diff --git a/debian/daemontools-man/setuidgid.8 b/debian/daemont   
   ols-man/setuidgid.djb.8   
   similarity index 100%   
   rename from debian/daemontools-man/setuidgid.8   
   rename to debian/daemontools-man/setuidgid.djb.8   
   diff --git a/debian/daemontools-man/softlimit.8 b/debian/daemont   
   ols-man/softlimit.djb.8   
   similarity index 100%   
   rename from debian/daemontools-man/softlimit.8   
   rename to debian/daemontools-man/softlimit.djb.8   
   diff --git a/debian/daemontools.alternatives b/debian/daemontools.alternatives   
   new file mode 100644   
   index 0000000..9ea64ae   
   --- /dev/null   
   +++ b/debian/daemontools.alternatives   
   @@ -0,0 +1,23 @@   
   +Name: daemontools   
   +Link: /usr/bin/envdir   
   +Alternative: /usr/bin/envdir.djb   
   +Dependents:   
   + /usr/bin/envuidgid envuidgid /usr/bin/envuidgid.djb   
   + /usr/bin/pgrphack pgrphack /usr/bin/pgrphack.djb   
   + /usr/bin/setlock setlock /usr/bin/setlock.djb   
   + /usr/bin/setuidgid setuidgid /usr/bin/setuidgid.djb   
   + /usr/bin/softlimit softlimit /usr/bin/softlimit.djb   
   + /usr/share/man/man8/envdir.8.gz envdir.8.gz /usr/share/man/ma   
   8/envdir.djb.8.gz   
   + /usr/share/man/man8/envuidgid.8.gz envuidgid.8.gz /usr/share/   
   an/man8/envuidgid.djb.8.gz   
   + /usr/share/man/man8/pgrphack.8.gz pgrphack.8.gz /usr/share/ma   
   /man8/pgrphack.djb.8.gz   
   + /usr/share/man/man8/setlock.8.gz setlock.8.gz /usr/share/man/   
   an8/setlock.djb.8.gz   
   + /usr/share/man/man8/setuidgid.8.gz setuidgid.8.gz /usr/share/   
   an/man8/setuidgid.djb.8.gz   
   + /usr/share/man/man8/softlimit.8.gz softlimit.8.gz /usr/share/   
   an/man8/softlimit.djb.8.gz   
   +Priority: 50   
   +   
   +Name: fghack   
   +Link: /usr/bin/fghack   
   +Alternative: /usr/bin/fghack.djb   
   +Dependents:   
   + /usr/share/man/man8/fghack.8.gz fghack.8.gz /usr/share/man/ma   
   8/fghack.djb.8.gz   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|