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: Tue, 22 Nov 2016 23:57:42 +0100 Message-ID: <87poln86mx.fsf@gnu.org> References: <87a8cuaszg.fsf@dustycloud.org> <878tsdbx2d.fsf@dustycloud.org> <87polpo2k4.fsf@gmail.com> <877f7wbyc7.fsf@dustycloud.org> 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]:59169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9K0a-0006n8-Kt for guix-devel@gnu.org; Tue, 22 Nov 2016 17:57:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9K0X-0006JL-Ft for guix-devel@gnu.org; Tue, 22 Nov 2016 17:57:48 -0500 In-Reply-To: <877f7wbyc7.fsf@dustycloud.org> (Christopher Allan Webber's message of "Mon, 21 Nov 2016 10:18:48 -0600") 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: Christopher Allan Webber Cc: guix-devel@gnu.org Christopher Allan Webber skribis: > Chris Marusich writes: > >>>> - Initializing a data store. For example, in dirvish I need to run >>>> a command to initialize a "vault" where I will be storing my data. >>>> - Manually invoking a garbage collection utility. >>>> - Manually invoking an integrity check utility. >>>> - Possibly some side effect involving querying the network. >>>> - Running schema migrations. >>>> >>>> All sorts of things! Most of them (all?) involve state or side effect= s, >>>> but plenty of our most important services will be "state overlords" of >>>> some type. >> >> Why do those activities need to be represented as actions in Shepherd? >> If we're running a daemon or service that already exposes a mechanism >> for manually running tasks like these, then can't we just use "the usual >> mechanism" for doing it? For example, if we're running a daemon that >> already provides a script to perform garbage collection, can't we just >> invoke that script? It isn't clear to me why we would need to model >> domain-specific actions like that in Shepherd, although I can see why it >> might be convenient. Am I missing something? > > So sure, we can run "foo-db gc" occasionally (though system > administrators sometimes have to run these kinds of commands by hand). > But what about "foo-db dumpdb"? That's not something we just run on a > cronjob. You need access to that command. And in order for the command > to do the right thing, it might need access to the config file. Oh I see, so the main issue is getting a hand on that config file. In that case, yes, a Shepherd action would a good way to achieve it. It=E2=80=99s also a situation where adding the config file to /etc would be reasonable (until Shepherd actions can actually be added :-)). > There are some other things where we can try to initialize or run > migrations automatically, but that stuff can be very dangerous to just > do implicitly. Now note, I *do* think we want to handle some of this > stuff behind the scenes as much as possible so that users don't have to > think about it. But have you ever done a *really big* database schema > migration? I guess not ;-), but I think it may be best to simply prevent the DB service from starting when a migration needs to happen, and let the user handle it explicitly and restart the DB service when they=E2=80=99re done. Ludo=E2=80=99.