* provide sysv-like command line utilities
-* Add OnlyByDependency
-
* ability to kill services? i.e. in contrast to stopping them, go directly
into killing mode?
- nscd DONE
- dbus DONE
- rsyslog DONE
- - rpcbind (/var/run/rpcbind.sock!)
- - avahi-daemon (/var/run/avahi-daemon/socket)
- - cups
+ - rpcbind (/var/run/rpcbind.sock!) DONE
+ - cups DONE
+ - avahi-daemon (/var/run/avahi-daemon/socket) DONE
- ssh CLASSIC
- postfix, saslauthd
- apache/samba
* Figure out which signal handlers we actually have to reset in the
forked off child
-* loopback-setup is borked for ipv6
+* Add code to systemctl to wait for an operation to finish
Regularly:
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+
#include "dbus-unit.h"
#include "dbus-socket.h"
#include "dbus-execute.h"
BUS_INTROSPECTABLE_INTERFACE
"</node>";
+static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_socket_append_bind_ipv6_only, socket_address_bind_ipv6_only, SocketAddressBindIPv6Only);
+
DBusHandlerResult bus_socket_message_handler(Unit *u, DBusMessage *message) {
const BusProperty properties[] = {
BUS_UNIT_PROPERTIES,
- { "org.freedesktop.systemd1.Socket", "BindIPv6Only", bus_property_append_bool, "b", &u->socket.bind_ipv6_only },
+ { "org.freedesktop.systemd1.Socket", "BindIPv6Only", bus_socket_append_bind_ipv6_only, "s", &u->socket.bind_ipv6_only },
{ "org.freedesktop.systemd1.Socket", "Backlog", bus_property_append_unsigned, "u", &u->socket.backlog },
{ "org.freedesktop.systemd1.Socket", "TimeoutUSec", bus_property_append_usec, "t", &u->socket.timeout_usec },
/* ExecCommand */
void *data,
void *userdata) {
- int r;
Socket *s;
+ SocketAddressBindIPv6Only b;
assert(filename);
assert(lvalue);
s = (Socket*) data;
- if ((r = parse_boolean(rvalue)) < 0) {
- log_error("[%s:%u] Failed to parse bind IPv6 only value: %s", filename, line, rvalue);
- return r;
- }
+ if ((b = socket_address_bind_ipv6_only_from_string(rvalue)) < 0) {
+ int r;
- s->bind_ipv6_only = r ? SOCKET_ADDRESS_IPV6_ONLY : SOCKET_ADDRESS_BOTH;
+ if ((r = parse_boolean(rvalue)) < 0) {
+ log_error("[%s:%u] Failed to parse bind IPv6 only value: %s", filename, line, rvalue);
+ return -EBADMSG;
+ }
+
+ s->bind_ipv6_only = r ? SOCKET_ADDRESS_IPV6_ONLY : SOCKET_ADDRESS_BOTH;
+ } else
+ s->bind_ipv6_only = b;
return 0;
}
return path_startswith(a->sockaddr.un.sun_path, prefix);
}
+
+static const char* const socket_address_bind_ipv6_only_table[_SOCKET_ADDRESS_BIND_IPV6_ONLY_MAX] = {
+ [SOCKET_ADDRESS_DEFAULT] = "default",
+ [SOCKET_ADDRESS_BOTH] = "both",
+ [SOCKET_ADDRESS_IPV6_ONLY] = "ipv6-only"
+};
+
+DEFINE_STRING_TABLE_LOOKUP(socket_address_bind_ipv6_only, SocketAddressBindIPv6Only);
typedef enum SocketAddressBindIPv6Only {
SOCKET_ADDRESS_DEFAULT,
SOCKET_ADDRESS_BOTH,
- SOCKET_ADDRESS_IPV6_ONLY
+ SOCKET_ADDRESS_IPV6_ONLY,
+ _SOCKET_ADDRESS_BIND_IPV6_ONLY_MAX,
+ _SOCKET_ADDRESS_BIND_IPV6_ONLY_INVALID = -1
} SocketAddressBindIPv6Only;
#define socket_address_family(a) ((a)->sockaddr.sa.sa_family)
bool socket_address_needs_mount(const SocketAddress *a, const char *prefix);
+const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b);
+SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s);
+
#endif
"%sSocketMode: %04o\n"
"%sDirectoryMode: %04o\n",
prefix, socket_state_to_string(s->state),
- prefix, yes_no(s->bind_ipv6_only),
+ prefix, socket_address_bind_ipv6_only_to_string(s->bind_ipv6_only),
prefix, s->backlog,
prefix, kill_mode_to_string(s->kill_mode),
prefix, s->socket_mode,
SocketAddress address;
char *path;
-
Watch fd_watch;
LIST_FIELDS(SocketPort, port);
LIST_HEAD(SocketPort, ports);
/* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */
- bool bind_ipv6_only;
+ SocketAddressBindIPv6Only bind_ipv6_only;
unsigned backlog;
usec_t timeout_usec;