summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rwxr-xr-xinit/init.c7
-rw-r--r--init/init_parser.c5
-rw-r--r--init/readme.txt2
3 files changed, 8 insertions, 6 deletions
diff --git a/init/init.c b/init/init.c
index 8f95da7..75ffb5c 100755
--- a/init/init.c
+++ b/init/init.c
@@ -206,9 +206,10 @@ void service_start(struct service *svc, const char *dynamic_args)
add_environment(ei->name, ei->value);
for (si = svc->sockets; si; si = si->next) {
- int s = create_socket(si->name,
- !strcmp(si->type, "dgram") ?
- SOCK_DGRAM : SOCK_STREAM,
+ int socket_type = (
+ !strcmp(si->type, "stream") ? SOCK_STREAM :
+ (!strcmp(si->type, "dgram") ? SOCK_DGRAM : SOCK_SEQPACKET));
+ int s = create_socket(si->name, socket_type,
si->perm, si->uid, si->gid);
if (s >= 0) {
publish_socket(si->name, s);
diff --git a/init/init_parser.c b/init/init_parser.c
index 585a5b5..d136c28 100644
--- a/init/init_parser.c
+++ b/init/init_parser.c
@@ -587,8 +587,9 @@ static void parse_line_service(struct parse_state *state, int nargs, char **args
parse_error(state, "socket option requires name, type, perm arguments\n");
break;
}
- if (strcmp(args[2],"dgram") && strcmp(args[2],"stream")) {
- parse_error(state, "socket type must be 'dgram' or 'stream'\n");
+ if (strcmp(args[2],"dgram") && strcmp(args[2],"stream")
+ && strcmp(args[2],"seqpacket")) {
+ parse_error(state, "socket type must be 'dgram', 'stream' or 'seqpacket'\n");
break;
}
si = calloc(1, sizeof(*si));
diff --git a/init/readme.txt b/init/readme.txt
index a185790..df524a6 100644
--- a/init/readme.txt
+++ b/init/readme.txt
@@ -72,7 +72,7 @@ setenv <name> <value>
socket <name> <type> <perm> [ <user> [ <group> ] ]
Create a unix domain socket named /dev/socket/<name> and pass
- its fd to the launched process. <type> must be "dgram" or "stream".
+ its fd to the launched process. <type> must be "dgram", "stream" or "seqpacket".
User and group default to 0.
user <username>