Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#27692 - [vde2] won't start due to missing /run/vde

Attached to Project: Arch Linux
Opened by Neil Darlow (neildarlow) - Friday, 23 December 2011, 21:14 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 13 June 2012, 12:29 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: vde2 no longer creates /run/vde and fails to start vde_switch


Additional info:
vde2-2.3.2-1


Steps to reproduce:
1) Update vde2 to affected version
2) Note that vde_switch no longer starts at boot

Manually create /run/vde and execute /etc/rc.d/vde start and now vde_switch starts successfully.
This task depends upon

Closed by  Dave Reisner (falconindy)
Wednesday, 13 June 2012, 12:29 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Nothing to do here. If you want to stray from the defaults, you need to provide those directories yourself.
Comment by Dave Reisner (falconindy) - Sunday, 15 January 2012, 03:25 GMT
This seems a bit strange to me... vde wants to write to /run/vde.ctl, not /run/vde. And sure enough, /run/vde.ctl is created on startup.
Comment by Neil Darlow (neildarlow) - Sunday, 15 January 2012, 11:32 GMT
If you look at /etc/vde/vde-config.sample (which users should base their VDE config on) it defines two variables as follows:

VDE_SOCK="/var/run/vde/sample.sock" # control directory pathname
VDE_MANAGEMENT_SOCK="/var/run/vde/sample.mgmt" # path of the management UNIX socket

/etc/rc.d/vde will honour those settings when starting. So, I guess, the start script should create the directory part of what both those variables define.

@Dave Reisner: Did you start vde without any such configuration specified in /etc/conf.d/vde via the VDE_CONFIG variable?
Comment by Dave Reisner (falconindy) - Saturday, 28 April 2012, 15:44 GMT
I don't use the /etc/conf.d file, because I wrote my own systemd unit which doesn't reference it. vde is capable of creating the directory where the control socket goes, as shown in the code for vde_switch:

432 » /* resolve ctl_socket, eventually defaulting to standard paths */
433 » if (rel_ctl_socket == NULL) {
434 » » rel_ctl_socket = (geteuid()==0)?VDESTDSOCK:VDETMPSOCK;
435 » }
436 » if (((mkdir(rel_ctl_socket, 0777) < 0) && (errno != EEXIST))) {
437 » » fprintf(stderr,"Cannot create ctl directory '%s': %s\n",
438 » » » rel_ctl_socket, strerror(errno));
439 » » exit(-1);
440 » }

rel_ctl_socket is tied to the -sock option, which defaults to /tmp/vde.ctl for non-root, and /var/run/vde.ctl for root. Regardless, the specified directory is created for you.

It'd be interesting to see a stack trace of the startup to see why this fails for you.
Comment by Neil Darlow (neildarlow) - Thursday, 03 May 2012, 09:01 GMT
I think the problem is that the code is capable of creating /run/vde.ctl/ but not /run/somedir/vde.ctl/

This might be acceptable for many reasons but the sample configuration file suggests that it should be capable of doing so. It's just one of those occasions where documentation and reality don't agree.

Not a show-stopper but likely to trip-up the unwary who follow the documentation and examples. No action required, I guess.
Comment by Dave Reisner (falconindy) - Thursday, 03 May 2012, 10:19 GMT
What an insane supposition...

$ sudo strace -e mkdir /usr/bin/vde_switch -tap tap1 -mod 660 -group kvm -sock /home/noclaf/vde.ctl
mkdir("/home/noclaf/vde.ctl", 0777) = 0
--- {si_signo=SIGALRM, si_code=SI_KERNEL, si_value={int=1113522544, ptr=0x7f62425f0170}} (Alarm clock) ---
^C

Looks like it's quite capable of making a directory wherever it pleases, just as the code shows.
Comment by Neil Darlow (neildarlow) - Thursday, 03 May 2012, 13:18 GMT
I based my "supposition" on the fact that /run/vde/ did not exist as a directory when e.g. /run/vde/vde.ctl was to be created.

My understanding of mkdir(3p) is that it would throw either an ENOENT or ENOTDIR error under such conditions. In your example, did /home/noclaf already exist before execution?
Comment by Dave Reisner (falconindy) - Thursday, 03 May 2012, 14:55 GMT
Ah, right. When a fragment of the full path doesn't exist, you get an ENOENT because mkdir(3) has the behavior of mkdir(1) without the -p flag.

So, the only thing "broken" here is that parent directory is expected to exist, and "classic" /var/run wasn't mounted on tmpfs. If you wanted to deviate from the default, you would need to provide a tmpfiles.d fragment.

Loading...