diff options
-rw-r--r-- | doc/s6-rc-update.html | 13 | ||||
-rw-r--r-- | src/libs6rc/s6rc_servicedir_manage.c | 24 |
2 files changed, 26 insertions, 11 deletions
diff --git a/doc/s6-rc-update.html b/doc/s6-rc-update.html index ac8377a..965cc70 100644 --- a/doc/s6-rc-update.html +++ b/doc/s6-rc-update.html @@ -245,5 +245,18 @@ restart. </li> <li> It will rename <tt>sqld</tt> to <tt>mysqld</tt> and make it restart. </ul> +<h2> Notes </h2> + +<ul> + <li> The old compiled service database is left unchanged, and the new compiled +service database is used in-place. If the machine is rebooted, the +<a href="s6-rc-init.html">s6-rc-init</a> invocation will still boot on the +old compiled unless more work is performed. It is recommended to keep a +<tt>current</tt> symbolic link to the current compiled, to always +<a href="s6-rc-init.html">s6-rc-init</a> on <tt>current</tt>, and to +make <tt>current</tt> point to the new compiled right after a s6-rc-update +invocation. </li> +</ul> + </body> </html> diff --git a/src/libs6rc/s6rc_servicedir_manage.c b/src/libs6rc/s6rc_servicedir_manage.c index e06d7a4..a6775f1 100644 --- a/src/libs6rc/s6rc_servicedir_manage.c +++ b/src/libs6rc/s6rc_servicedir_manage.c @@ -39,28 +39,30 @@ int s6rc_servicedir_manage (char const *live, tain_t const *deadline, tain_t *st if (d->d_name[0] == '.') continue ; { unsigned int len = str_len(d->d_name) ; + int r ; uint16 id ; char srcfn[livelen + 20 + len] ; char dstfn[livelen + 10 + len] ; - register int r ; byte_copy(srcfn, livelen + 12, dirfn) ; srcfn[livelen + 12] = '/' ; byte_copy(srcfn + livelen + 13, len + 1, d->d_name) ; r = s6_svc_ok(srcfn) ; if (r < 0) { e = errno ; goto err ; } - if (r) continue ; - byte_copy(srcfn + livelen + 13 + len, 6, "/down") ; - if (!touch(srcfn)) { e = errno ; goto err ; } - byte_copy(srcfn + livelen + 14 + len, 6, "event") ; - if (!ftrigw_fifodir_make(srcfn, gid, 0)) { e = errno ; goto err ; } - id = ftrigr_subscribe(&a, srcfn, "s", 0, deadline, stamp) ; - if (!id) { e = errno ; goto err ; } - if (!genalloc_append(uint16, &ids, &id)) { e = errno ; goto err ; } - srcfn[livelen + 13 + len] = 0 ; + if (!r) + { + byte_copy(srcfn + livelen + 13 + len, 6, "/down") ; + if (!touch(srcfn)) { e = errno ; goto err ; } + byte_copy(srcfn + livelen + 14 + len, 6, "event") ; + if (!ftrigw_fifodir_make(srcfn, gid, 0)) { e = errno ; goto err ; } + id = ftrigr_subscribe(&a, srcfn, "s", 0, deadline, stamp) ; + if (!id) { e = errno ; goto err ; } + if (!genalloc_append(uint16, &ids, &id)) { e = errno ; goto err ; } + srcfn[livelen + 13 + len] = 0 ; + } byte_copy(dstfn, livelen, live) ; byte_copy(dstfn + livelen, 9, "/scandir/") ; byte_copy(dstfn + livelen + 9, len + 1, d->d_name) ; - if (symlink(srcfn, dstfn) < 0) { e = errno ; goto err ; } + if (symlink(srcfn, dstfn) < 0 && (!r || errno != EEXIST)) { e = errno ; goto err ; } } } if (errno) { e = errno ; goto err ; } |