* swap units that are activated by one name but shown in the kernel under another are semi-broken
+* Fix assert http://lists.freedesktop.org/archives/systemd-devel/2011-April/001910.html
+
+* 0595f9a1c182a84581749823ef47c5f292e545f9 is borked, freezes shutdown
+ (path: after installing inotify watches, recheck file again to fix race)
+
+F15 External:
+
* NFS, networkmanager ordering issue (PENDING)
* NM should pull in network.target (PENDING)
* bluetooth should be possible to disable (PENDING)
-* 0595f9a1c182a84581749823ef47c5f292e545f9 is borked, freezes shutdown
- (path: after installing inotify watches, recheck file again to fix race)
-
* get writev() /dev/kmsg support into the F15 kernel
https://lkml.org/lkml/2011/4/6/473
patched merged into -mm
* make anaconda write timeout=0 for encrypted devices
-* Fix assert http://lists.freedesktop.org/archives/systemd-devel/2011-April/001910.html
-
Features:
* maybe lower default timeout to 2min?
* support wildcard expansion in ListeStream= and friends
-* Add ListenSpecial to .socket units for /proc/kmsg and similar friends?
-
* avoid DefaultStandardOutput=syslog to have any effect on StandardInput=socket services
* use pivot_root on shutdown so that we can unmount the root directory.
directive above.</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>ListenSpecial=</varname></term>
+ <listitem><para>Specifies a special
+ file in the file system to listen
+ on. This expects an absolute file
+ system path as argument. Behaviour
+ otherwise is very similar to the
+ <varname>ListenFIFO=</varname>
+ directive above. Use this to open
+ character device nodes as well as
+ special files in
+ <filename>/proc</filename> and
+ <filename>/sys</filename>.</para></listitem>
+ </varlistentry>
+
<varlistentry>
<term><varname>ListenNetlink=</varname></term>
<listitem><para>Specifies a Netlink
}
path_kill_slashes(p->path);
+
+ } else if (streq(lvalue, "ListenSpecial")) {
+ p->type = SOCKET_SPECIAL;
+
+ if (!(p->path = strdup(rvalue))) {
+ free(p);
+ return -ENOMEM;
+ }
+
+ path_kill_slashes(p->path);
+
} else if (streq(lvalue, "ListenNetlink")) {
p->type = SOCKET_SOCKET;
{ "ListenSequentialPacket", config_parse_listen, 0, &u->socket, "Socket" },
{ "ListenFIFO", config_parse_listen, 0, &u->socket, "Socket" },
{ "ListenNetlink", config_parse_listen, 0, &u->socket, "Socket" },
+ { "ListenSpecial", config_parse_listen, 0, &u->socket, "Socket" },
{ "BindIPv6Only", config_parse_socket_bind, 0, &u->socket, "Socket" },
{ "Backlog", config_parse_unsigned, 0, &u->socket.backlog, "Socket" },
{ "BindToDevice", config_parse_bindtodevice, 0, &u->socket, "Socket" },
if (socket_address_needs_mount(&p->address, prefix))
return true;
} else {
- assert(p->type == SOCKET_FIFO);
+ assert(p->type == SOCKET_FIFO || p->type == SOCKET_SPECIAL);
if (path_startswith(p->path, prefix))
return true;
}
fprintf(f, "%s%s: %s\n", prefix, listen_lookup(socket_address_family(&p->address), p->address.type), t);
free(k);
- } else
+ } else if (p->type == SOCKET_SPECIAL)
+ fprintf(f, "%sListenSpecial: %s\n", prefix, p->path);
+ else
fprintf(f, "%sListenFIFO: %s\n", prefix, p->path);
}
log_warning("F_SETPIPE_SZ: %m");
}
-
static int fifo_address_create(
const char *path,
mode_t directory_mode,
return r;
}
+static int special_address_create(
+ const char *path,
+ int *_fd) {
+
+ int fd = -1, r = 0;
+ struct stat st;
+
+ assert(path);
+ assert(_fd);
+
+ if ((fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW)) < 0) {
+ r = -errno;
+ goto fail;
+ }
+
+ if (fstat(fd, &st) < 0) {
+ r = -errno;
+ goto fail;
+ }
+
+ /* Check whether this is a /proc, /sys or /dev file or char device */
+ if (!S_ISREG(st.st_mode) && !S_ISCHR(st.st_mode)) {
+ r = -EEXIST;
+ goto fail;
+ }
+
+ *_fd = fd;
+ return 0;
+
+fail:
+ if (fd >= 0)
+ close_nointr_nofail(fd);
+
+ return r;
+}
+
static int socket_open_fds(Socket *s) {
SocketPort *p;
int r;
socket_apply_socket_options(s, p->fd);
+ } else if (p->type == SOCKET_SPECIAL) {
+
+ if ((r = special_address_create(
+ p->path,
+ &p->fd)) < 0)
+ goto rollback;
+
} else if (p->type == SOCKET_FIFO) {
if ((r = fifo_address_create(
else
unit_serialize_item_format(u, f, "socket", "%i %i %s", copy, p->address.type, t);
free(t);
- } else {
+ } else if (p->type == SOCKET_SPECIAL)
+ unit_serialize_item_format(u, f, "special", "%i %s", copy, p->path);
+ else {
assert(p->type == SOCKET_FIFO);
unit_serialize_item_format(u, f, "fifo", "%i %s", copy, p->path);
}
else {
LIST_FOREACH(port, p, s->ports)
- if (streq(p->path, value+skip))
+ if (p->type == SOCKET_FIFO &&
+ streq_ptr(p->path, value+skip))
+ break;
+
+ if (p) {
+ if (p->fd >= 0)
+ close_nointr_nofail(p->fd);
+ p->fd = fdset_remove(fds, fd);
+ }
+ }
+
+ } else if (streq(key, "special")) {
+ int fd, skip = 0;
+ SocketPort *p;
+
+ if (sscanf(value, "%i %n", &fd, &skip) < 1 || fd < 0 || !fdset_contains(fds, fd))
+ log_debug("Failed to parse special value %s", value);
+ else {
+
+ LIST_FOREACH(port, p, s->ports)
+ if (p->type == SOCKET_SPECIAL &&
+ streq_ptr(p->path, value+skip))
break;
if (p) {
typedef enum SocketType {
SOCKET_SOCKET,
SOCKET_FIFO,
+ SOCKET_SPECIAL,
_SOCKET_FIFO_MAX,
_SOCKET_FIFO_INVALID = -1
} SocketType;