guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (Exposing?) config files and non-start/stop operations


From: Christopher Allan Webber
Subject: Re: (Exposing?) config files and non-start/stop operations
Date: Sun, 27 Nov 2016 09:47:08 -0600
User-agent: mu4e 0.9.16; emacs 25.1.1

Ludovic Courtès writes:

> Ricardo Wurmus <address@hidden> skribis:
>
>> Christopher Allan Webber <address@hidden> writes:
>>
>>>  - We could also have a shepherd action like "herd config mediagoblin"
>>>    that would merely spit out the configuration file path... so someone
>>>    could do something like:
>>>      $ foo-db dump-db --config `herd config foo-db`
>>
>> Here’s another similar idea:
>>
>>     herd environment <service> -- some command
>>
>> The environment for a service may be represented by a bunch of
>> environment variables.  “some command” then runs within this
>> environment and can access the variables.
>>
>> So if “foo-db” can read its configuration file from FOO_DB_CONFIG the
>> environment definition would be something like
>>
>>     #~(("FOO_DB_CONFIG" . (string-append #$foo-db "/etc/config")))
>
> Problem is that in many cases the config file is passed via a
> command-line option to the daemon.
>
> Ludo’.

Yeah, I'm not sure it would work.

But if we were looking for inspiration in what other things have been
done in Guix, we could do something along the lines of "guix system vm"
where it returns a path to a derivation with the appropriate wrapping
already done, something like:

  `herd cmd <service>` --some --args

It's a bit hacky in a different way though!

 - Chris



reply via email to

[Prev in Thread] Current Thread [Next in Thread]