From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: (Exposing?) config files and non-start/stop operations Date: Sat, 26 Nov 2016 18:40:00 +0100 Message-ID: <871sxyp2bz.fsf@gnu.org> References: <87a8cuaszg.fsf@dustycloud.org> <878tsdbx2d.fsf@dustycloud.org> <87polpo2k4.fsf@gmail.com> <877f7wbyc7.fsf@dustycloud.org> <87poln86mx.fsf@gnu.org> <87mvgpj1kq.fsf@dustycloud.org> <87shqh57ht.fsf@gnu.org> <87fumghvdc.fsf@dustycloud.org> <87eg1yz72t.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAgxL-0003At-OM for guix-devel@gnu.org; Sat, 26 Nov 2016 12:40:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAgxH-0006p0-AQ for guix-devel@gnu.org; Sat, 26 Nov 2016 12:40:07 -0500 In-Reply-To: <87eg1yz72t.fsf@elephly.net> (Ricardo Wurmus's message of "Sat, 26 Nov 2016 14:47:22 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org Ricardo Wurmus skribis: > Christopher Allan Webber 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=E2=80=99s another similar idea: > > herd environment -- some command > > The environment for a service may be represented by a bunch of > environment variables. =E2=80=9Csome command=E2=80=9D then runs within t= his > environment and can access the variables. > > So if =E2=80=9Cfoo-db=E2=80=9D can read its configuration file from FOO_D= B_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=E2=80=99.