Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] systemd-tmpfiles failed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jang0
n00b
n00b


Joined: 09 Nov 2020
Posts: 72

PostPosted: Thu Apr 01, 2021 3:26 pm    Post subject: [SOLVED] systemd-tmpfiles failed Reply with quote

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.
Code:

# 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:
Code:

 * 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
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Sat Apr 03, 2021 2:09 pm    Post subject: Reply with quote

Are you running openrc or systemd?
I am confused....
please try
Code:

ls -ld /var
ls -l /var

_________________
:)


Last edited by alamahant on Sat Apr 03, 2021 2:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
hdcg
Tux's lil' helper
Tux's lil' helper


Joined: 07 Apr 2013
Posts: 120

PostPosted: Sat Apr 03, 2021 2:25 pm    Post subject: Reply with quote

Looks like such errors may happen in case of mismatching ownership: https://github.com/systemd/systemd/issues/11282
What's the output of
Code:
stat / /var /var/lib
Back to top
View user's profile Send private message
jang0
n00b
n00b


Joined: 09 Nov 2020
Posts: 72

PostPosted: Sat Apr 03, 2021 7:19 pm    Post subject: Reply with quote

I'm running openrc.
Code:

# 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!
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2719

PostPosted: Sat Apr 03, 2021 7:33 pm    Post subject: Reply with quote

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
Code:
RDEPEND="
    || (
        sys-apps/systemd-tmpfiles
        sys-apps/opentmpfiles
        sys-apps/systemd
    )"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum