Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603106 - <net-misc/radvd-2.16 fails to start on boot due to missing /run/radvd
Summary: <net-misc/radvd-2.16 fails to start on boot due to missing /run/radvd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Michael Weber (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-12-19 14:46 UTC by Randy Barlow
Modified: 2017-08-19 10:13 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Barlow 2016-12-19 14:46:14 UTC
When I boot my system, radvd fails to start:

$ sudo systemctl status radvd
Password: 
● radvd.service - Router advertisement daemon for IPv6
   Loaded: loaded (/usr/lib64/systemd/system/radvd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2016-12-18 17:05:19 EST; 16h ago
     Docs: man:radvd(8)
  Process: 941 ExecStart=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0 (code=exited, status=255)
  Process: 844 ExecStartPre=/usr/sbin/radvd --configtest (code=exited, status=0/SUCCESS)

Dec 18 17:05:14 scurvy systemd[1]: Starting Router advertisement daemon for IPv6...
Dec 18 17:05:19 scurvy radvd[844]: [Dec 18 17:05:19] radvd (844): config file, /etc/radvd.conf, syntax ok
Dec 18 17:05:19 scurvy systemd[1]: radvd.service: Control process exited, code=exited status=255
Dec 18 17:05:19 scurvy systemd[1]: Failed to start Router advertisement daemon for IPv6.
Dec 18 17:05:19 scurvy systemd[1]: radvd.service: Unit entered failed state.
Dec 18 17:05:19 scurvy systemd[1]: radvd.service: Failed with result 'exit-code'.
Dec 18 17:05:19 scurvy radvd[941]: [Dec 18 17:05:19] radvd (941): version 2.14 started
Dec 18 17:05:19 scurvy radvd[941]: [Dec 18 17:05:19] radvd (941): unable to open pid file, /var/run/radvd/radvd.pid: Permission denied

A simple mkdir fixes it, but since /var/tmp is a tmpfs I have to do that every boot:

$ sudo mkdir /var/run/radvd
$ sudo systemctl start radvd
$ sudo systemctl status radvd
● radvd.service - Router advertisement daemon for IPv6
   Loaded: loaded (/usr/lib64/systemd/system/radvd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2016-12-19 09:39:24 EST; 2s ago
     Docs: man:radvd(8)
  Process: 29595 ExecStart=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0 (code=exited, status=0/SUCCESS)
  Process: 29591 ExecStartPre=/usr/sbin/radvd --configtest (code=exited, status=0/SUCCESS)
 Main PID: 29598 (radvd)
   CGroup: /system.slice/radvd.service
           ├─29598 /usr/sbin/radvd --username radvd --logmethod stderr --debug 0
           └─29599 /usr/sbin/radvd --username radvd --logmethod stderr --debug 0

Dec 19 09:39:24 scurvy systemd[1]: Starting Router advertisement daemon for IPv6...
Dec 19 09:39:24 scurvy radvd[29591]: [Dec 19 09:39:24] radvd (29591): config file, /etc/radvd.conf, syntax ok
Dec 19 09:39:24 scurvy radvd[29595]: [Dec 19 09:39:24] radvd (29595): version 2.14 started
Dec 19 09:39:24 scurvy systemd[1]: Started Router advertisement daemon for IPv6.
Comment 1 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-12-22 16:12:31 UTC
please try with radvd-2.15-r1  updated build options to specify /run instead of /var/run (/run is specified in tmpfiles.d)
Comment 2 Randy Barlow 2017-01-15 05:27:00 UTC
Hello Matthew!

I've updated to net-misc/radvd-2.15-r1:0 and the problem still happens, but now with the /run folder instead of the /var/run folder:

rpbarlow@scurvy ~ $ sudo systemctl status radvd
● radvd.service - Router advertisement daemon for IPv6
   Loaded: loaded (/usr/lib64/systemd/system/radvd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2017-01-14 21:02:53 EST; 3h 20min ago
     Docs: man:radvd(8)
  Process: 862 ExecStart=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0 (code=exited, status=255)
  Process: 818 ExecStartPre=/usr/sbin/radvd --configtest (code=exited, status=0/SUCCESS)

Jan 14 21:02:51 scurvy systemd[1]: Starting Router advertisement daemon for IPv6...
Jan 14 21:02:53 scurvy radvd[818]: [Jan 14 21:02:53] radvd (818): config file, /etc/radvd.conf, syntax ok
Jan 14 21:02:53 scurvy radvd[862]: [Jan 14 21:02:53] radvd (862): version 2.15 started
Jan 14 21:02:53 scurvy radvd[862]: [Jan 14 21:02:53] radvd (862): unable to open pid file, /run/radvd/radvd.pid: Permission denied
Jan 14 21:02:53 scurvy systemd[1]: radvd.service: Control process exited, code=exited status=255
Jan 14 21:02:53 scurvy systemd[1]: Failed to start Router advertisement daemon for IPv6.
Jan 14 21:02:53 scurvy systemd[1]: radvd.service: Unit entered failed state.
Jan 14 21:02:53 scurvy systemd[1]: radvd.service: Failed with result 'exit-code'.


Similar to last time, I can work around this issue by using mkdir, but on the /run folder instead of on the /var/run folder:

$ sudo mkdir /run/radvd
Comment 3 Michael Weber (RETIRED) gentoo-dev 2017-02-01 10:03:48 UTC
I think the problem is that tmpfiles.d need /etc/init.d/opentmpfiles-setup restarted to be executed. Normally a reboot.

Or by properly using tmpfiles.eclass.

commit f2146e7a0aa26abcb5a6ea1292d353da4a8c7865
Author: Michael Weber <xmw@gentoo.org>
Date:   Wed Feb 1 10:59:59 2017 +0100

    net-misc/radvd: Version bump. Fix tmpfiles.d issue (bug 603106, thanks Randy Barlow).
    
    Package-Manager: Portage-2.3.3, Repoman-2.3.1
Comment 4 Randy Barlow 2017-02-13 03:51:37 UTC
Hello again!

I updated to radvs-2.16 but the problem remains. Immediately after boot, the service has entered a failed state:


$ sudo systemctl status radvd
Password: 
● radvd.service - Router advertisement daemon for IPv6
   Loaded: loaded (/usr/lib64/systemd/system/radvd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2017-02-12 22:46:34 EST; 1min 50s ago
     Docs: man:radvd(8)
  Process: 807 ExecStart=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0 (code=exited, status=255)
  Process: 799 ExecStartPre=/usr/sbin/radvd --configtest (code=exited, status=0/SUCCESS)

Feb 12 22:46:33 scurvy systemd[1]: Starting Router advertisement daemon for IPv6...
Feb 12 22:46:34 scurvy systemd[1]: radvd.service: Control process exited, code=exited status=255
Feb 12 22:46:34 scurvy systemd[1]: Failed to start Router advertisement daemon for IPv6.
Feb 12 22:46:34 scurvy systemd[1]: radvd.service: Unit entered failed state.
Feb 12 22:46:34 scurvy systemd[1]: radvd.service: Failed with result 'exit-code'.
Feb 12 22:46:34 scurvy radvd[799]: [Feb 12 22:46:34] radvd (799): config file, /etc/radvd.conf, syntax ok
Feb 12 22:46:34 scurvy radvd[807]: [Feb 12 22:46:34] radvd (807): version 2.16 started
Feb 12 22:46:34 scurvy radvd[807]: [Feb 12 22:46:34] radvd (807): unable to open pid file, /run/radvd/radvd.pid: Permission denied
$ ls -lah /run/radvd
ls: cannot access '/run/radvd': No such file or directory


It seems that I can mkdir /run/radvd to get it working again:

$ sudo mkdir /run/radvd
Comment 5 Maxime de Roucy 2017-02-27 22:48:15 UTC
I use net-misc/radvd-2.14.
To solve this problem I modified ExecStart in the service file :

root@max-server # systemctl cat radvd.service
# /usr/lib/systemd/system/radvd.service
[Unit]
Description=Router advertisement daemon for IPv6
Documentation=man:radvd(8)
After=network.target

[Service]
Type=forking
ExecStartPre=/usr/sbin/radvd --configtest
ExecStart=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0
ExecReload=/usr/sbin/radvd --configtest ; \
           /bin/kill -HUP $MAINPID
CPUSchedulingPolicy=idle
PIDFile=/run/radvd/radvd.pid
RuntimeDirectory=radvd
CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_NET_BIND_SERVICE  CAP_NET_RAW
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
NoNewPrivileges=yes

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/radvd.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0 --pidfile /run/radvd/radvd.pid


root@max-server # systemctl show -p ExecStart radvd.service
ExecStart={ path=/usr/sbin/radvd ; argv[]=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0 --pidfile /run/radvd/radvd.pid ; ignore_errors=no ;  …
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2017-08-16 22:11:18 UTC
Got this error on net-misc/radvd-2.17 today (systemd system).
It's not fixed.

I think it happens because systemd has two conflisting mechanisms to
create /var/run/:

Via .service file:
  RuntimeDirectory=radvd
  ProtectSystem=full

And via .tmpfilesd:
  d	/run/radvd	0755 radvd radvd

Systemd end up trying to start radvd in empty /var/.

To workaround the problem I suggest removing .tmpfilesd entirely from ebuild.
Openrs creates /run/ files anyways in init.d script using checkpath:
    checkpath -d -o radvd:radvd ${PIDFILE%/*}

WDYT?
--- radvd-2.17.ebuild   2017-07-18 09:25:29.900943230 +0100
+++ radvd-2.17-r1.ebuild        2017-08-16 23:10:11.373925283 +0100
@@ -5,3 +5,3 @@
 
-inherit systemd user eutils readme.gentoo-r1 tmpfiles
+inherit systemd user eutils readme.gentoo-r1
 
@@ -49,3 +49,2 @@
        systemd_dounit "${FILESDIR}"/${PN}.service
-       systemd_newtmpfilesd  "${FILESDIR}"/${PN}.tmpfilesd ${PN}.conf
 
@@ -59,6 +58,2 @@
 }
-
-pkg_postinst() {
-       tmpfiles_process ${PN}.conf
-}
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2017-08-19 10:13:11 UTC
Pushed to the tree as: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=564e4ed0715605dafe41568a3eb6690102cf6ca0

Thanks for the report!