diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-06-14 04:37:32 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-06-14 04:37:32 +0000 |
| commit | 87b8fcabeecf2a9cff2ca596da54d6c1cf17d89f (patch) | |
| tree | bc07d6d01afac944925d43108fda8b91ef2fe12f /src/libs6rc/s6rc_servicedir_internal.c | |
| parent | 958958d74337a6ddaf649968d188e768984100e0 (diff) | |
| download | s6-rc-87b8fcabeecf2a9cff2ca596da54d6c1cf17d89f.tar.gz | |
Prepare for 0.7.0.0; lots of changes!
- s6-rc-bundle deleted. Changing bundles without recompiling is not
supported anymore. (It works, but it incentivizes poor workflows; it is
better to handle stuff at the source level and recompile when in doubt,
that's what s6-frontend does.)
- new db format, need to recompile and use s6-rc-format-upgrade on new live db
- support for the reload-signal file in service directories
- new reload scripts for oneshots (which is why the db format has changed)
- new "s6-rc reload" command, calling s6-svc -l on longruns (which makes use
of reload-signal, HUP by default) and the reload script on oneshots
- the live state now tracks when a service has been explicitly brought up
as opposed to by pulled by dependencies. Nothing uses the feature for now
but now the tech is there for an auto-stop-if-unneeded feature.
Diffstat (limited to 'src/libs6rc/s6rc_servicedir_internal.c')
| -rw-r--r-- | src/libs6rc/s6rc_servicedir_internal.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libs6rc/s6rc_servicedir_internal.c b/src/libs6rc/s6rc_servicedir_internal.c index e81f378..5c55d28 100644 --- a/src/libs6rc/s6rc_servicedir_internal.c +++ b/src/libs6rc/s6rc_servicedir_internal.c @@ -27,7 +27,7 @@ static s6_servicedir_desc const svdir_file_list[] = { .name = "down-signal", .type = S6_FILETYPE_NORMAL, .options = 0 }, { .name = "reload-signal", .type = S6_FILETYPE_NORMAL, .options = 0 }, { .name = "flag-newpidns", .type = S6_FILETYPE_EMPTY, .options = 0 }, - { .name = "template", .type = S6_FILETYPE_DIR, .options = 0 }, + { .name = "template", .type = S6_FILETYPE_TEMPLATE, .options = 0 }, { .name = "data", .type = S6_FILETYPE_DIR, .options = 0 }, { .name = "env", .type = S6_FILETYPE_DIR, .options = 0 }, { .name = 0, .options = 0 } @@ -61,7 +61,7 @@ int s6rc_servicedir_copy_one (char const *src, char const *dst, s6_servicedir_de break ; } case S6_FILETYPE_EMPTY : - if (access(srcfn, F_OK) < 0) + if (access(srcfn, F_OK) == -1) { if (errno != ENOENT || p->options & S6_SVFILE_MANDATORY) return 0 ; } @@ -81,16 +81,17 @@ int s6rc_servicedir_copy_one (char const *src, char const *dst, s6_servicedir_de } break ; } + case S6_FILETYPE_TEMPLATE : case S6_FILETYPE_DIR : if (!hiercopy(srcfn, dstfn)) { - 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 ; + if (errno != ENOENT) return 0 ; + if (p->options & S6_SVFILE_MANDATORY) return 0 ; + break ; } + if (p->type != S6_FILETYPE_TEMPLATE) break ; + memcpy(dstfn + dstlen + 1, "instance", 9) ; + if (mkdir(dstfn, 0755) == -1 && errno != EEXIST) return 0 ; break ; default : return (errno = EDOM, 0) ; } |
