Bug 45861 - UCS 4.3: runsvdir can't be started
UCS 4.3: runsvdir can't be started
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.3
Assigned To: Jürn Brodersen
Felix Botner
: interim-1
: 45862 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-12 16:39 CET by Stefan Gohmann
Modified: 2018-03-14 14:38 CET (History)
4 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2017-12-12 16:39:22 CET
runsv isn't started after upgrading from UCS 4.2 to a preview of UCS 4.3. Thus, some basic services are not available:


Dez 12 16:01:13 master421 univention-runit[399]: Starting Univention process supervision: univention-runitstart-stop-daemon: unable to stat /usr/sbin/runsvdir-start (No such file or directory)
Dez 12 16:01:13 master421 univention-runit[399]:  failed!
Dez 12 16:01:13 master421 systemd[1]: univention-runit.service: Control process exited, code=exited status=2
Dez 12 16:01:13 master421 systemd[1]: Failed to start LSB: Univention process supervision.
Dez 12 16:01:13 master421 systemd[1]: univention-runit.service: Unit entered failed state.
Dez 12 16:01:13 master421 systemd[1]: univention-runit.service: Failed with result 'exit-code'.
Comment 1 Jürn Brodersen univentionstaff 2017-12-12 16:59:24 CET
From /usr/share/doc/runit/NEWS.Debian.gz

'''
runit (2.1.2-4) unstable; urgency=medium

    Runit no longer provides /sbin/runsvdir-start symbolic link to
    /etc/runit/2. Everything this package provides now directly
    refers to /etc/runit/2, including systemd's service file, but
    scripts and configuration outside may be need updated.
'''
Comment 2 Felix Botner univentionstaff 2017-12-12 17:47:21 CET
*** Bug 45862 has been marked as a duplicate of this bug. ***
Comment 3 Felix Botner univentionstaff 2017-12-12 18:09:53 CET
so after 

base/univention-runit/debian/univention-runit.init
base/univention-runit/debian/univention-runit.postinst

runit seem to start, but on my system (update from 4.2-3 to 4.3) /etc/service is a link to /etc/runit/runsvdir/default and all sv start univention... failed because sv uses /etc/service


univention-runit.postinst has some code to create a proper /etc/service link, but only if  /etc/service is not link, so in my case "somebody" create a "wrong" /etc/service link, univention-runit did not update /etc/service to the correct univention link /etc/runit/univention and all sv start univention-di... failed.

my workaround was rm /etc/service and ln -s /etc/runit/univention /etc/service

after that service bind9/univention-directory-listener works
Comment 4 Jürn Brodersen univentionstaff 2017-12-14 17:54:44 CET
faf83fc9
link /etc/runit/univention -> /etc/service for 4.3-0

6fbcc0a1
change daemon path
Comment 5 Felix Botner univentionstaff 2017-12-18 15:58:48 CET
works, but maybe better to check if the link is not "/etc/runit/univention"

-elif [ "$(readlink /etc/service)" = "runit/runsvdir/default" ]; then
+elif [ "$(readlink /etc/service)" != "/etc/runit/univention" ]; then

or?
Comment 6 Daniel Tröder univentionstaff 2017-12-19 09:48:56 CET
Replacing runsv with systemd would be complexity reduction for UCS 4.3.
Comment 7 Felix Botner univentionstaff 2017-12-19 16:20:06 CET
another problem

the new runit package replaces the /etc/service link upon unpack (very early in the update process). Until the configuration of univention-runit (postinst repairs the /etc/service link), very late in the update process, runit is broken (because /etc/service is empty). But runit/systemd tries to reload/restart services and with the empty /etc/services all services are stopped (bind, listener, notifier) now during the update.

So 

(a)
we have to restart the runit services.

(b)
remove the /etc/service link from the runit package

What i did to test this, was to create the new runit directory before the update.

 mkdir -p /etc/runit/runsvdir/default
 cp -a /etc/service/* /etc/runit/runsvdir/default

This way runit also works during the period were the link is broken. All runit services were properly restarted/reloaded during the update and running after the update.
Comment 8 Felix Botner univentionstaff 2017-12-19 17:58:52 CET
(In reply to Felix Botner from comment #7)
> another problem
> 
> the new runit package replaces the /etc/service link upon unpack (very early
> in the update process). Until the configuration of univention-runit
> (postinst repairs the /etc/service link), very late in the update process,
> runit is broken (because /etc/service is empty). But runit/systemd tries to
> reload/restart services and with the empty /etc/services all services are
> stopped (bind, listener, notifier) now during the update.
> 
> So 
> 
> (a)
> we have to restart the runit services.
> 
> (b)
> remove the /etc/service link from the runit package
> 
> What i did to test this, was to create the new runit directory before the
> update.
> 
>  mkdir -p /etc/runit/runsvdir/default
>  cp -a /etc/service/* /etc/runit/runsvdir/default
> 
> This way runit also works during the period were the link is broken. All
> runit services were properly restarted/reloaded during the update and
> running after the update.

better solution

updater preup
 -> /etc/runit/runsvdir
 -> ln -s /etc/runit/univention /etc/runit/runsvdir/default

univention-runit
 ensure that /etc/runit/runsvdir/default exists and is a link to /etc/runit/univention
 remove the /etc/runit/univention /etc/service stuff

seems that the runit package overwrites the /etc/service link but not /etc/runit/runsvdir/default, so we can simply link /etc/runit/runsvdir/default to the univention runit directory and keep the /etc/service default
Comment 9 Jürn Brodersen univentionstaff 2017-12-19 18:31:50 CET
In case the solution above doesn't work:
We might be able to use "/usr/bin/runsvdir /etc/runit/univention" in the univention-runit init script instead of "/etc/runit/2"
Comment 10 Jürn Brodersen univentionstaff 2018-02-05 10:36:56 CET
6d53c0d2: link /etc/runit/univention to /etc/runit/runsvdir/default instead of /etc/serivce

Does this need a changelog entry?
Comment 11 Felix Botner univentionstaff 2018-02-05 11:46:16 CET
(In reply to Jürn Brodersen from comment #10)
> 6d53c0d2: link /etc/runit/univention to /etc/runit/runsvdir/default instead
> of /etc/serivce

OK

> Does this need a changelog entry?

yes, just a short notice that we changed the runit config according to debian stretch
Comment 12 Jürn Brodersen univentionstaff 2018-02-05 12:50:06 CET
92198d08: changelog
Comment 13 Felix Botner univentionstaff 2018-02-05 16:36:09 CET
OK
Comment 14 Stefan Gohmann univentionstaff 2018-03-14 14:38:04 CET
UCS 4.3 has been released:
 https://docs.software-univention.de/release-notes-4.3-0-en.html
 https://docs.software-univention.de/release-notes-4.3-0-de.html

If this error occurs again, please use "Clone This Bug".