Happening on Archlinux, systemd with /var/run symlinked to /run. systemctl start nmb [2019/04/07 08:36:32.254927, 0] ../../lib/util/become_daemon.c:122(exit_daemon) exit_daemon: daemon failed to start: Failed to create directory for pid files, check 'pid directory', error code 17 pid directory is /var/run (default) The root cause is a rewrite in Samba in lib/util/util.c in 4.10, 'directory_create_or_exist' which does: ret = mkdir(dname, dir_perms); ... if (ret != 0 && errno == EEXIST) { ... ret = lstat(dname, &sbuf); ... if (!S_ISDIR(sbuf.st_mode)) { return false; } } This means with /var/run being a symlink to /run, this fails. lstat doesn't follow the symbolic link, but returns information about the symbolic link. I personally would use 'stat', follow the symlink and check if the referenced file descriptor is a directory. Also I would first check if the directory already exists and not blindly excute a 'mkdir' and check for EEXIST. I don't see the benefit of doing that.