# [SOLVED] systemd-tmpfiles failed

## jang0

Hello!

virtual/tmpfiles is a package pulled by services like fail2ban, it creates a openrc service: stmpfiles-setup that fail when I mount /var on a separated partition and make fail2ban service crash if I execute it before stmpfiles-setup.

```

# cat stmpfiles-setup

description="Set up tmpfiles.d entries"

depend()

{

   provide stmpfiles-setup stmpfiles.setup tmpfiles-setup tmpfiles.setup

   need localmount

}

start()

{

   ebegin "Setting up tmpfiles.d entries"

   /bin/systemd-tmpfiles --exclude-prefix=/dev --create --remove --boot \

      ${stmpfiles_opts}

   eend $?

}

```

The rc.log is: 

```

 * Setting up tmpfiles.d entries ...

Detected unsafe path transition /var  /var/lib during canonicalization of /var/lib.

Detected unsafe path transition /var  /var/cache during canonicalization of /var/cache.

Detected unsafe path transition /var  /var/cache during canonicalization of /var/cache.

 [ !! ]

 * ERROR: stmpfiles-setup failed to start

 * Starting fail2ban ...

Server ready

```

Is stmpfiles-setup service indispensable? should I fix it? could I omit it?Last edited by jang0 on Sat Apr 03, 2021 7:21 pm; edited 1 time in total

----------

## alamahant

Are you running openrc or systemd?

I am confused....

please try

```

ls -ld /var

ls -l /var

```

----------

## hdcg

Looks like such errors may happen in case of mismatching ownership: https://github.com/systemd/systemd/issues/11282

What's the output of 

```
stat / /var /var/lib
```

----------

## jang0

I'm running openrc.

```

# ls -ld /var

drwxr-xr-x. 11 nginx nginx 4096 Mar  1 19:53 /var

# chown root:root /var

# rc-service stmpfiles-setup restart

 * WARNING: you are stopping a boot service

 * Setting up tmpfiles.d entries ...              [ ok ]

```

It was an ownership error, surely I commit it configuring Nginx server.

Thank you all!

----------

## Ionen

 *alamahant wrote:*   

> Are you running openrc or systemd?

 systemd-tmpfiles is something you use only without systemd because systemd otherwise provide it, so definitely not systemd (same idea as sys-fs/udev).

opentmpfiles has some issues and limitations that nobody really been fixing, so systemd-tmpfiles became the default for virtual/tmpfiles (used by new installations only unless you manually migrate for now). It's the reference implementation and can function without having systemd installed, so there was no point in reinventing the wheel further

```
RDEPEND="

    || (

        sys-apps/systemd-tmpfiles

        sys-apps/opentmpfiles

        sys-apps/systemd

    )"
```

----------

