unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#72920] [PATCH 0/3] Clean out /run upon boot
@ 2024-08-31 19:42 Ludovic Courtès
  2024-08-31 19:47 ` [bug#72920] [PATCH 1/3] services: cleanup: Run under C.UTF-8 locale Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ludovic Courtès @ 2024-08-31 19:42 UTC (permalink / raw)
  To: 72920; +Cc: Ludovic Courtès, Vagrant Cascadian, 64775, 72670

Hello,

This fixes <https://issues.guix.gnu.org/64775> and
<https://issues.guix.gnu.org/72670>, the latter being an illustration
of the former.

Thoughts?

Thanks,
Ludo’.

Ludovic Courtès (3):
  services: cleanup: Run under C.UTF-8 locale.
  services: cleanup: Create directories with the right mode upfront.
  services: cleanup: Delete /run upon boot.

 gnu/services.scm | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)


base-commit: 61a7930cb03f5eb9e8003bade21d61262c3db8df
-- 
2.45.2





^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#72920] [PATCH 1/3] services: cleanup: Run under C.UTF-8 locale.
  2024-08-31 19:42 [bug#72920] [PATCH 0/3] Clean out /run upon boot Ludovic Courtès
@ 2024-08-31 19:47 ` Ludovic Courtès
  2024-08-31 19:47 ` [bug#72920] [PATCH 2/3] services: cleanup: Create directories with the right mode upfront Ludovic Courtès
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2024-08-31 19:47 UTC (permalink / raw)
  To: 72920; +Cc: Ludovic Courtès

* gnu/services.scm (cleanup-gexp): Use “C.UTF-8” instead of
“en_US.utf8”; leave ‘GUIX_LOCPATH’ unchanged.

Change-Id: I8ba4f5343f168b0fd4d7310916f47ee98003d8ef
---
 gnu/services.scm | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index f0bbbb27a5..ce13c087ce 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -656,11 +656,7 @@ (define (cleanup-gexp _)
 
            ;; Force file names to be decoded as UTF-8.  See
            ;; <https://bugs.gnu.org/26353>.
-           (setenv "GUIX_LOCPATH"
-                   #+(file-append
-                      (libc-utf8-locales-for-target (%current-system))
-                      "/lib/locale"))
-           (setlocale LC_CTYPE "en_US.utf8")
+           (setlocale LC_CTYPE "C.UTF-8")
            (delete-file-recursively "/tmp")
            (delete-file-recursively "/var/run")
 
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#72920] [PATCH 2/3] services: cleanup: Create directories with the right mode upfront.
  2024-08-31 19:42 [bug#72920] [PATCH 0/3] Clean out /run upon boot Ludovic Courtès
  2024-08-31 19:47 ` [bug#72920] [PATCH 1/3] services: cleanup: Run under C.UTF-8 locale Ludovic Courtès
@ 2024-08-31 19:47 ` Ludovic Courtès
  2024-09-21  1:11   ` Hilton Chain via Guix-patches via
  2024-08-31 19:47 ` [bug#72920] [PATCH 3/3] services: cleanup: Delete /run upon boot Ludovic Courtès
  2024-09-20 21:26 ` [bug#72920] [PATCH 0/3] Clean out " Vagrant Cascadian
  3 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2024-08-31 19:47 UTC (permalink / raw)
  To: 72920; +Cc: Ludovic Courtès

* gnu/services.scm (cleanup-gexp): Pass mode as second argument to
‘mkdir’; remove ‘chmod’ calls.

Change-Id: I8ac2dde0ca5d9bd6b2ef104d77141d8463d8b3fa
---
 gnu/services.scm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index ce13c087ce..4a8e2b3b15 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -660,10 +660,8 @@ (define (cleanup-gexp _)
            (delete-file-recursively "/tmp")
            (delete-file-recursively "/var/run")
 
-           (mkdir "/tmp")
-           (chmod "/tmp" #o1777)
-           (mkdir "/var/run")
-           (chmod "/var/run" #o755)
+           (mkdir "/tmp" #o1777)
+           (mkdir "/var/run" #o755)
            (delete-file-recursively "/run/udev/watch.old"))))))
 
 (define cleanup-service-type
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#72920] [PATCH 3/3] services: cleanup: Delete /run upon boot.
  2024-08-31 19:42 [bug#72920] [PATCH 0/3] Clean out /run upon boot Ludovic Courtès
  2024-08-31 19:47 ` [bug#72920] [PATCH 1/3] services: cleanup: Run under C.UTF-8 locale Ludovic Courtès
  2024-08-31 19:47 ` [bug#72920] [PATCH 2/3] services: cleanup: Create directories with the right mode upfront Ludovic Courtès
@ 2024-08-31 19:47 ` Ludovic Courtès
  2024-09-20 21:26 ` [bug#72920] [PATCH 0/3] Clean out " Vagrant Cascadian
  3 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2024-08-31 19:47 UTC (permalink / raw)
  To: 72920; +Cc: Vagrant Cascadian, Ludovic Courtès

Fixes <https://issues.guix.gnu.org/64775>.

* gnu/services.scm (cleanup-gexp): Delete /run and recreate it.

Reported-by: Vagrant Cascadian <vagrant@debian.org>
Change-Id: Iae39f1aa734712a3755b24b156802ec0282d3f14
---
 gnu/services.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index 4a8e2b3b15..9d278f11ab 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -632,7 +632,7 @@ (define (cleanup-gexp _)
     #~(begin
         (use-modules (guix build utils))
 
-        ;; Clean out /tmp and /var/run.
+        ;; Clean out /tmp, /var/run, and /run.
         ;;
         ;; XXX This needs to happen before service activations, so it
         ;; has to be here, but this also implicitly assumes that /tmp
@@ -659,10 +659,11 @@ (define (cleanup-gexp _)
            (setlocale LC_CTYPE "C.UTF-8")
            (delete-file-recursively "/tmp")
            (delete-file-recursively "/var/run")
+           (delete-file-recursively "/run")
 
            (mkdir "/tmp" #o1777)
            (mkdir "/var/run" #o755)
-           (delete-file-recursively "/run/udev/watch.old"))))))
+           (mkdir "/run" #o755))))))
 
 (define cleanup-service-type
   ;; Service that cleans things up in /tmp and similar.
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#72920] [PATCH 0/3] Clean out /run upon boot
  2024-08-31 19:42 [bug#72920] [PATCH 0/3] Clean out /run upon boot Ludovic Courtès
                   ` (2 preceding siblings ...)
  2024-08-31 19:47 ` [bug#72920] [PATCH 3/3] services: cleanup: Delete /run upon boot Ludovic Courtès
@ 2024-09-20 21:26 ` Vagrant Cascadian
  2024-09-25 14:26   ` bug#72920: " Ludovic Courtès
  3 siblings, 1 reply; 8+ messages in thread
From: Vagrant Cascadian @ 2024-09-20 21:26 UTC (permalink / raw)
  To: Ludovic Courtès, 72920; +Cc: 64775, 72670

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

On 2024-08-31, Ludovic Courtès wrote:
> Ludovic Courtès (3):
>   services: cleanup: Run under C.UTF-8 locale.
>   services: cleanup: Create directories with the right mode upfront.
>   services: cleanup: Delete /run upon boot.

As they say, Looks Good To Me. :)

live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#72920] [PATCH 2/3] services: cleanup: Create directories with the right mode upfront.
  2024-08-31 19:47 ` [bug#72920] [PATCH 2/3] services: cleanup: Create directories with the right mode upfront Ludovic Courtès
@ 2024-09-21  1:11   ` Hilton Chain via Guix-patches via
  2024-09-25 16:14     ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Hilton Chain via Guix-patches via @ 2024-09-21  1:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 72920

Hi Ludo,

On Sun, 01 Sep 2024 03:47:23 +0800,
Ludovic Courtès wrote:
>
> * gnu/services.scm (cleanup-gexp): Pass mode as second argument to
> ‘mkdir’; remove ‘chmod’ calls.
>
> Change-Id: I8ac2dde0ca5d9bd6b2ef104d77141d8463d8b3fa
> ---
>  gnu/services.scm | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/services.scm b/gnu/services.scm
> index ce13c087ce..4a8e2b3b15 100644
> --- a/gnu/services.scm
> +++ b/gnu/services.scm
> @@ -660,10 +660,8 @@ (define (cleanup-gexp _)
>             (delete-file-recursively "/tmp")
>             (delete-file-recursively "/var/run")
>
> -           (mkdir "/tmp")
> -           (chmod "/tmp" #o1777)
> -           (mkdir "/var/run")
> -           (chmod "/var/run" #o755)
> +           (mkdir "/tmp" #o1777)
> +           (mkdir "/var/run" #o755)
>             (delete-file-recursively "/run/udev/watch.old"))))))
>
>  (define cleanup-service-type

It seems that the mode is not applied correctly:

--8<---------------cut here---------------start------------->8---
$ guile -c '(mkdir "/tmp/test" #o1777)' && stat /tmp/test
[...]
Access: (1755/drwxr-xr-t)  Uid: ( 1000/    hako)   Gid: (  998/   users)
[...]
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ guile -c '(and (mkdir "/tmp/test2") (chmod "/tmp/test2" #o1777))' && stat /tmp/test2
[...]
Access: (1777/drwxrwxrwt)  Uid: ( 1000/    hako)   Gid: (  998/   users)
[...]
--8<---------------cut here---------------end--------------->8---

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#72920: [PATCH 0/3] Clean out /run upon boot
  2024-09-20 21:26 ` [bug#72920] [PATCH 0/3] Clean out " Vagrant Cascadian
@ 2024-09-25 14:26   ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2024-09-25 14:26 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: 64775-done, 72670-done, 72920-done

Vagrant Cascadian <vagrant@debian.org> skribis:

> On 2024-08-31, Ludovic Courtès wrote:
>> Ludovic Courtès (3):
>>   services: cleanup: Run under C.UTF-8 locale.
>>   services: cleanup: Create directories with the right mode upfront.
>>   services: cleanup: Delete /run upon boot.
>
> As they say, Looks Good To Me. :)

Thanks, pushed as c250033aa69f35e64949a87fd8482b253dd416b4, except for
the first one because I remembered that C.UTF-8 is unavailable in
cross-compiled programs.

Ludo’.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#72920] [PATCH 2/3] services: cleanup: Create directories with the right mode upfront.
  2024-09-21  1:11   ` Hilton Chain via Guix-patches via
@ 2024-09-25 16:14     ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2024-09-25 16:14 UTC (permalink / raw)
  To: Hilton Chain; +Cc: 72920-done

Hi Hilton,

Hilton Chain <hako@ultrarare.space> skribis:


[...]

>> -           (mkdir "/tmp")
>> -           (chmod "/tmp" #o1777)
>> -           (mkdir "/var/run")
>> -           (chmod "/var/run" #o755)
>> +           (mkdir "/tmp" #o1777)
>> +           (mkdir "/var/run" #o755)
>>             (delete-file-recursively "/run/udev/watch.old"))))))
>>
>>  (define cleanup-service-type
>
> It seems that the mode is not applied correctly:
>
> $ guile -c '(mkdir "/tmp/test" #o1777)' && stat /tmp/test
> [...]
> Access: (1755/drwxr-xr-t)  Uid: ( 1000/    hako)   Gid: (  998/   users)

Oops, I saw your message too late, apologies.

Commit f92151133da4b98f98e755ce0996e8be59acac72 fixes that and adds a
test so we can catch it next time.

The story is that the 2nd argument to ‘mkdir’ is and’ed with umask,
something that I had forgotten.

Thanks and sorry for the mess.

Ludo’.




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-09-25 16:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-31 19:42 [bug#72920] [PATCH 0/3] Clean out /run upon boot Ludovic Courtès
2024-08-31 19:47 ` [bug#72920] [PATCH 1/3] services: cleanup: Run under C.UTF-8 locale Ludovic Courtès
2024-08-31 19:47 ` [bug#72920] [PATCH 2/3] services: cleanup: Create directories with the right mode upfront Ludovic Courtès
2024-09-21  1:11   ` Hilton Chain via Guix-patches via
2024-09-25 16:14     ` Ludovic Courtès
2024-08-31 19:47 ` [bug#72920] [PATCH 3/3] services: cleanup: Delete /run upon boot Ludovic Courtès
2024-09-20 21:26 ` [bug#72920] [PATCH 0/3] Clean out " Vagrant Cascadian
2024-09-25 14:26   ` bug#72920: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).