Сохраните файлы в/tmp, использующем systemd в 15,04

Если возможный я хотел бы сохранить/tmp/foo /* через начальные загрузки. Мои попытки конфигурирования tmpfiles.d были неудачны. Как базируются, я создал /etc/tmpfiles.d/foo.conf с содержанием:

x /tmp/foo/*

XOR

X /tmp/foo - - - - -

XOR

x /tmp/foo - - - - -

Ни одно из тех редактирований не работало.

Согласно man tmpfiles.d x обозначает, "Игнорируют путь во время очистки", которая является точно, что я хотел бы сделать. В той странице справочника существует даже пример (#2) о том, как выполнить это.

Однако на перезагрузке,/tmp/foo всегда отсутствует. Что я делаю неправильно? Действительно ли tmpfiles.d является способом выполнить это в 15,04?

3
задан 1 May 2015 в 01:31

1 ответ

Вам нужно это:

x /tmp/foo - - - - -

, Но примечание это:

Note that lines of this type do not influence the effect of r or R lines. 

страница справочника:

r

Remove a file or directory if it exists. This may not be used to 
remove non-empty directories, use R for that. Lines of this type 
accept shell-style globs in place of normal path names. Does not 
follow symlinks.

R

Recursively remove a path and all its subdirectories (if it is a 
directory). Lines of this type accept shell-style globs in place of 
normal path names. Does not follow symlinks.



x

Ignore a path during cleaning. Use this type to exclude paths from 
clean-up as controlled with the Age parameter. Note that lines of this 
type do not influence the effect of r or R lines. Lines of this type 
accept shell-style globs in place of normal path names.

The configuration format is one line per path containing type, path, 
mode, ownership, age, and argument fields:

     #Type Path        Mode UID  GID  Age Argument
     d    /run/user   0755 root root 10d -
     L    /tmp/foobar -    -    -    -   /dev/null

Fields may be enclosed within quotes and contain C-style escapes.

Источник

0
ответ дан 1 December 2019 в 23:10

Другие вопросы по тегам:

Похожие вопросы: