guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] dmd: Make config file if necessary when not run as root.


From: Ludovic Courtès
Subject: Re: [PATCH 2/2] dmd: Make config file if necessary when not run as root.
Date: Wed, 05 Feb 2014 21:17:56 +0100
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Alex Sassmannshausen <address@hidden> skribis:

> Ludovic Courtès writes:

[...]

>>> + (register-services)
>>    ^
>>> +;; Send dmd into the background
>>> + (action 'dmd 'daemonize)
>>    ^
>>> + (for-each start '())
>>    ^
>>
>> Extra space here.
>
> The extra spaces were there to stop emacs (maybe Scheme mode?) from
> going nutty because of the open parens within a string at column 0.

Oh, right, I forgot that.

[...]

>>>          (let ((config-file (string-append user-dmddir "/init.scm")))
>>>            (cond ((not (file-exists? user-dmddir))
>>>                   (mkdir user-dmddir)
>>> +                 (make-bare-init-file config-file)
>>>                   config-file)
>>> +                ((not (file-exists? config-file))
>>> +                 (make-bare-init-file config-file))
>>>                  (else config-file))))))
>>
>> So I guess this should be changed to:
>>
>>   (catch 'system-error
>>     (lambda ()
>>       (mkdir user-dmddir)
>>       (make-bare-init-file config-file))
>>     (const #f))
>
> I've changed this to :
>
>          (catch-system-error (mkdir user-dmddir))
>          (if (not (file-exists? config-file))
>              (make-bare-init-file config-file))
>          config-file)))

[...]

> I also think the race condition should not be a problem for the config
> file: if the config file is added after the check, then we simply
> override it. If the config file is removed after the check then guix
> crashes when it tries to load it, as it always would do before this
> patch.

Right.  Hopefully it’s not a problem with the test suite because tests
use ‘-c’ anyway.

> Hope this works now. You should find the patch inline.

Yep.  Pushed, thanks!

Ludo’.



reply via email to

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