From: rich@example.invalid   
      
   Sam wrote:   
   > Sylvain Robitaille writes:   
   >   
   >> On 2024-04-04, Sam wrote:   
   >> > My container configuration files are ordinary YAML files, ...   
   >>   
   >> ... "ordinary YAML" may be an oxymoron ... ;-)   
   >   
   > Less than "ordinary XML".   
   >   
   >> > a format that all new kids on the block understand. It's not like the   
   >> > archaic, Windows-like structure of systemd's unit configuration   
   >> > files.   
   >>   
   >> There's really nothing wrong with key=value simple text files. They're   
   >> easily human-readable, and (less easily, I admit) machine parsable.   
   >   
   > If all you need are a flat list of scalar options, perhaps.   
   >   
   > But try to add some complexity. Say, one set of options for specifying   
   > possibly multiple "before" dependencies, and another set of options for   
   > specifying possibly multiple "after" dependencies.   
   > ...   
      
   > Let's have a thought experiment. Here's cron's automatically-generated   
   > container, as a YAML configuration file:   
   >   
   > name: rc.crond   
   > description: /etc/rc.d/rc.crond   
   > starting:   
   > type: forking   
   > command: /etc/rc.d/rc.crond start   
   > stopping:   
   > type: manual   
   > command: /etc/rc.d/rc.crond stop   
   > before:   
   > - rc.smartd   
   > x-chmod-script: /etc/rc.d/rc.crond   
   > Version: 1   
   >   
   > Let's make up a comparable key=value file. Let's say, something like this:   
   >   
   > Name=rc.crond   
   > Description=/etc/rc.d/rc.crond   
   > StartType=forking   
   > StartCommand=/etc/rc.d/rc.crond start   
   > StopType=manual   
   > StopCommand=/etc/rc.d/rc.crond stop   
   > StopBefore=rc.smartd   
   > XChmodScript=etc/rc.d/rc.crond   
   > Version=1   
   >   
   > The YAML one looks cleaner to me, more expressive, and easier on the eyes.   
      
   I would have converted your YAML into INI format this way:   
      
   name=rc.crond   
   description=/etc/rc.d/rc.crond   
   x-chmod-script=/etc/rc.d/rc.crond   
   Version=1   
   [starting]   
   type=forking   
   command=/etc/rc.d/rc.crond start   
   [stopping]   
   type=manual   
   command=/etc/rc.d/rc.crond stop   
   [before]   
   commad=rc.smartd   
      
   I only had to make up one key name, for the - under before:, and this   
   more closely mirrors your yaml as well. The [...] section blocks are   
   in ini files for a reason, they provide first level grouping of keys and   
   values.   
      
   It might also need a starting [main] (or some other name) to make it   
   fully valid, I've not tried running it through an ini parser. And, ini   
   files do officially support comments, so the above can also be   
   (granted, these are made up here as I'm typing, so they seem rather   
   'redundant' given the names):   
      
   name=rc.crond   
   description=/etc/rc.d/rc.crond   
   x-chmod-script=/etc/rc.d/rc.crond   
   Version=1   
      
   how to start up the this unit   
      
   [starting]   
   type=forking   
   command=/etc/rc.d/rc.crond start   
      
   how to cleanly shutdown the unit   
      
   [stopping]   
   type=manual   
   command=/etc/rc.d/rc.crond stop   
      
   units that depend upon this one having been started before   
   they can themselves be started   
      
   [before]   
   unit=rc.smartd   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|