From c2df214e1cc4fea3b7df5a0f2116452a64900a24 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 2 Oct 2024 18:01:13 +0000 Subject: Create instance subdir when copying template Signed-off-by: Laurent Bercot --- src/libs6rc/s6rc_servicedir_internal.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/libs6rc/s6rc_servicedir_internal.c b/src/libs6rc/s6rc_servicedir_internal.c index 9c2e429..3735f2b 100644 --- a/src/libs6rc/s6rc_servicedir_internal.c +++ b/src/libs6rc/s6rc_servicedir_internal.c @@ -83,6 +83,11 @@ int s6rc_servicedir_copy_one (char const *src, char const *dst, s6_servicedir_de { if (errno != ENOENT || p->options & S6_SVFILE_MANDATORY) return 0 ; } + if (!strcmp(p->name, "template")) + { + memcpy(dstfn + dstlen + 1, "instance", 9) ; + if (mkdir(dstfn, 0755) == -1 && errno != EEXIST) return 0 ; + } break ; default : return (errno = EDOM, 0) ; } -- cgit v1.2.3