From 5246dd6cff3de43cb64326535696a16a351f831a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 22 Dec 2022 11:55:46 +0000 Subject: Add support for s6-instance Signed-off-by: Laurent Bercot --- src/libs6rc/s6rc_servicedir_internal.c | 2 ++ src/s6-rc/s6-rc-compile.c | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/libs6rc/s6rc_servicedir_internal.c b/src/libs6rc/s6rc_servicedir_internal.c index dfc0a44..2c2c859 100644 --- a/src/libs6rc/s6rc_servicedir_internal.c +++ b/src/libs6rc/s6rc_servicedir_internal.c @@ -24,6 +24,8 @@ static s6_servicedir_desc const svdir_file_list[] = { .name = "timeout-finish", .type = S6_FILETYPE_UINT, .options = 0 }, { .name = "max-death-tally", .type = S6_FILETYPE_UINT, .options = 0 }, { .name = "down-signal", .type = S6_FILETYPE_NORMAL, .options = 0 }, + { .name = "instance", .type = S6_FILETYPE_DIR, .options = 0 }, + { .name = "instances", .type = S6_FILETYPE_DIR, .options = 0 }, { .name = "data", .type = S6_FILETYPE_DIR, .options = 0 }, { .name = "env", .type = S6_FILETYPE_DIR, .options = 0 }, { .name = 0, .options = 0 } diff --git a/src/s6-rc/s6-rc-compile.c b/src/s6-rc/s6-rc-compile.c index 31bf3d0..3cd9b24 100644 --- a/src/s6-rc/s6-rc-compile.c +++ b/src/s6-rc/s6-rc-compile.c @@ -1384,6 +1384,14 @@ static inline void write_servicedirs (char const *compiled, s6rc_db_t const *db, memcpy(dstfn + clen + 14 + len, "down-signal", 12) ; filecopy_unsafe(srcfn, dstfn, 0644) ; + memcpy(srcfn + srcdirlen + len + 2, "instance", 9) ; + memcpy(dstfn + clen + 14 + len, "instance", 9) ; + dircopy(compiled, srcfn, dstfn) ; + + memcpy(srcfn + srcdirlen + len + 2, "instances", 10) ; + memcpy(dstfn + clen + 14 + len, "instances", 10) ; + dircopy(compiled, srcfn, dstfn) ; + memcpy(srcfn + srcdirlen + len + 2, "data", 5) ; memcpy(dstfn + clen + 14 + len, "data", 5) ; dircopy(compiled, srcfn, dstfn) ; -- cgit v1.2.3