# Boot-Warnings on 'Setting up tmpfiles.d entries ...'

## Palatonka

Since the last emerge there are strange warnings on bootup.

'Setting up tmpfiles.d entries ...':

mkdir: cannot create directory ?/run/apache2?: File already exists

mkdir: cannot create directory ?/run/apache_ssl?: File already exists

mkdir: cannot create directory ?/run/saslauthd?: File already exists

mkdir: cannot create directory ?/run/fetchmail?: File already exists

mkdir: cannot create directory ?/run/run/mysqld?: File already exists

mkdir: cannot create directory ?/run/run/samba?: File already exists

mkdir: cannot create directory ?/run/lock/samba?: File already exists

mkdir: cannot create directory ?/run/screen?: File already exists

mkdir: cannot create directory ?/run/openldap?: File already exists

These are the packages last emerged:

sys-libs/glibc-2.23-r3

dev-libs/libbsd-0.8.3

media-libs/lcms-2.8-r1

media-libs/jbig2dec-0.13-r1

app-eselect/eselect-vi-1.1.9

virtual/perl-Time-Local-1.230.0-r5

virtual/perl-Text-Tabs+Wrap-2013.52.300-r5

virtual/perl-Math-Complex-1.590.0-r8

virtual/perl-Time-HiRes-1.972.600-r4

virtual/perl-File-Path-2.90.0-r5

sys-devel/libtool-2.4.6-r3

dev-libs/libev-4.23

dev-db/sqlite-3.16.2

net-nds/openldap-2.4.44

sys-apps/opentmpfiles-0.1.1

virtual/tmpfiles-0

sys-apps/openrc-0.23.2

dev-libs/openssl-1.0.2k

x11-libs/pixman-0.34.0

net-misc/curl-7.53.0

sys-apps/openrc-0.23.2

sys-fs/udev-225-r1

sys-fs/udev-init-scripts-27

Thanks in advance for any help and kind regards!

----------

## NeddySeagoon

Palatonka,

Its not a problem in your case.

You upgraded to sys-apps/openrc-0.23.2, which installs opentmpfiles.

First some history.  A few years ago, /run did not exist and /var/run was used instead.

/run was invented to have some read write space available before root was mounted read/write.

At the same time, /run was made of type tmpfs, so its contents are lost at shutdown, unlike /var/run which was an disk somewhere.

This means that applications that needed directories in /run had to make their own every startup.

It was actually the init scripts in /etc/init.d that took care of it.

. 

opentmpfiles does this with sys-apps/openrc-0.23.2 so that functionality should have been removed from the init scripts that go with openrc-0.23.2.

It appears that you have both methods of making directories in /run and the one that tries to make the directories after they already exist isn't happy.

Did you run etc-update to update your init scripts?

----------

## cboldt

There is another thread, related.  seems that openrc-0.23 pulls in opentmpfiles.

In the other thread, there was a suggestion that having tmpfiles.dev and tmpfiles.setup in your initialization (run `rc-update show` to see what your openrc initialization does) might be superfluous, or that crating the necessary tmpfiles/tmpdirs can be done in other ways.  I just removed both of those init routines (tmpfiles.dev and tmpfiles.setup) from my boot routine - although I am not running openrc-0.23.  At least on one machine, the only one I have rebooted since, I detect no ramification.  I suspect that the systems I manage are simple enough that if there is a need for a tmpdirectory that isn't created automagically, I'll create it by hand rather than rely of the init scripts.

I know this doesn't fix your issue or even address precisely what throws those error messages, but if you are knowledgeable enough with the way the system and services initialize, my remarks might give you the courage to experiment.

----------

## Palatonka

Thanks first for your fast replys.

Yes, etc-update was done immediately after emerge.

----------

## Palatonka

rc-update:

```

...

     opentmpfiles-dev |                                        sysinit

   opentmpfiles-setup | boot

...

         tmpfiles.dev |                                        sysinit

       tmpfiles.setup | boot

                 udev |                                        sysinit

...

```

----------

## cboldt

Looks like duplication of init functions there.  I'd get rid of [at least] the "tmpfile" ones, they are replaced by the opentmpfile entries.

```
rc-update del tmpfiles.dev sysinit

rc-update del tmpfiles.setup boot
```

etc-update wouldn't even notice the duplication.

----------

## gsra99

I have removed tmpfiles.dev and tmpfiles.setup from runlevels but I still get the errors. Is there anything else I can try.

----------

## cboldt

You could try removing the opentmpfiles services, then seeing what other services are affected, if any.

It may be that all the tmp directories off ?/run (likely /var/run) for example apache2, apache_ssl, saslauthd, and so on, it may be that those exist as files in your filesystem, and aren't (and don't need to be) created "on the fly" at startup.

If they do exist, aside from being created by opentmpfiles-dev and opentmpfiles-setup, you could delete what I will call the "hard-linked" (to the filesystem) tmpfile folders, and keep the opentmpfiles services.

----------

## NeddySeagoon

cboldt,

/var/run has been a symlink to /run for a long time now.

```
$ ls -l /var/run

lrwxrwxrwx 1 root root 4 May 14  2013 /var/run -> /run
```

----------

## cboldt

Neddy - yes, that part I know.  Burned myself on some backup/mirror stuff, looking at /var/run in the backup and seeing the CURRENT contents of /run - forgetting the backup at /backup/var/run was nothing more than a softlink too.

I was thinking of you actually, and was going to mention that similar to how /dev can be mostly populated by a program (udev, etc.), or it can be populated manually, the "duplicates" warning from opentmpfiles services might be seeing manually created entries that do not go away on a power down.

----------

## Krog

so.... i have the same output and same stuff on my pc:

```
KROGPC-SKYLAKE conf.d # rc-update show|grep tmp   

     opentmpfiles-dev |                                 sysinit

   opentmpfiles-setup | boot                                   

```

and:

```
KROGPC-SKYLAKE conf.d # ls -l /var/run 

lrwxrwxrwx 1 root root 4 22 dic 03.09 /var/run -> /run

```

what is the proper thing to do? do i have to remove some folder from my hard disk so that these scripts will create them on the fly?

----------

## Palatonka

Problem seems to be fixed with latest opentmpfiles update.

----------

## Krog

i will try to update, thanks

----------

## NismoC32

I have similar problem with tempfiles problem.

I have removed the tempfiles from the runtime service and only having opentmpfiles in the runlevel boot and sysinit.

This is my rc-update list:

```

       NetworkManager |      default                                  

              apache2 |      default                                  

         avahi-daemon |      default                                  

               binfmt | boot                                          

             bootmisc | boot                                          

          consolefont | boot                                          

           consolekit |      default                                  

             cpupower |      default                                  

                 dbus |      default                                  

                devfs |                                        sysinit

        device-mapper |      default                                  

                dmesg |                                        sysinit

              dovecot |      default                                  

                 fsck | boot                                          

                  gpm |      default                                  

             hostname | boot                                          

              keymaps | boot                                          

            killprocs |                        shutdown               

    kmod-static-nodes |                                        sysinit

           lm_sensors |      default                                  

                local |      default nonetwork                        

           localmount | boot                                          

             loopback | boot                                          

              modules | boot                                          

             mount-ro |                        shutdown               

                 mtab | boot                                          

                mysql |      default                                  

               net.lo | boot                                          

             netmount |      default                                  

                  nfs |      default                                  

           ntp-client |      default                                  

                 ntpd |      default                                  

     opentmpfiles-dev |                                        sysinit

   opentmpfiles-setup | boot                                          

              php-fpm |      default                                  

              postfix |      default                                  

               procfs | boot                                          

               radarr |      default                                  

                redis |      default                                  

                 root | boot                                          

            rpc.statd |      default                                  

               rsyncd |      default                                  

                samba |      default                                  

            saslauthd |      default                                  

            savecache |                        shutdown               

               sonarr |      default                                  

                 sshd |      default                                  

               sysctl | boot                                          

                sysfs |                                        sysinit

            syslog-ng | boot                                          

         teamviewerd9 |      default                                  

         termencoding |      default                                                

                 udev |                                        sysinit

         udev-trigger |                                        sysinit

              urandom | boot                                          

           vixie-cron |      default                                  

                  xdm |      default                                  

               xinetd |      default
```

But I still get this error during boot and sometimes when I restart som services like apache.

I have opentmpfiles v0.1.3 installed.

This is from rc sysinit logg:

```
* Mounting /proc ...

 [ ok ]

 * Mounting /run ...

 * /run/openrc: creating directory

 * /run/lock: creating directory

 * /run/lock: correcting owner

 * Caching service dependencies ...

Error: tmpfiles.dev is the name of a real and virtual service.

Error: tmpfiles.setup is the name of a real and virtual service.
```

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]

----------

## NismoC32

Hi I still get this error.

Any Idea how to fix this ?

----------

