|
From: | Ricardo Wurmus |
Subject: | Re: (Exposing?) config files and non-start/stop operations |
Date: | Sat, 26 Nov 2016 14:47:22 +0100 |
User-agent: | mu4e 0.9.16; emacs 25.1.1 |
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"))) In this case a user could do herd environment foo-db -- foo-db dump-db If it doesn’t respect FOO_DB_CONFIG one could do herd environment foo-db -- 'foo-db dump-db --config $FOO_DB_CONFIG' This is all just a crummy bash translation of a reader monad. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC http://elephly.net
[Prev in Thread] | Current Thread | [Next in Thread] |