Bug 202707 - sysutils/runit: runsv searches in the wrong directory
Summary: sysutils/runit: runsv searches in the wrong directory
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-28 07:43 UTC by Sean Chittenden
Modified: 2015-09-08 17:49 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (crees)


Attachments
runit /service to /var/service fixup (4.17 KB, patch)
2015-08-28 07:43 UTC, Sean Chittenden
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Chittenden freebsd_committer freebsd_triage 2015-08-28 07:43:13 UTC
Created attachment 160433 [details]
runit /service to /var/service fixup

The sv(8) utility is hard coded to use /service as its startup directory.  FreeBSD ports change this value to be /var/service.  The sv(8) utility should be patched to search in /var/service for services.  Previously, sv(8) required a full path to the service directory that you wished to operate on.  For instance:

sv stat /var/service/openntpd

But it should be possible to run:

sv stat openntpd

and have sv(8) do the right thing.

Note:

The other way to do this would be to chase runit and start using /service, however I do not like its new default value:

1.9.0
Mon, 05 May 2008 22:00:13 +0000
  * doc/upgrade.html: typo.
  * sv.c: service name is also relative to the current directory if it
    ends with a slash.
  * change default directory for services from /var/service/ to /service/.
  * runsv.c: create temporary new status files for log/supervise/ actually
    in log/supervise/.
  * doc/benefits.html: minor additions.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-08-28 08:05:23 UTC
A commit references this bug:

Author: crees
Date: Fri Aug 28 08:04:40 UTC 2015
New revision: 395452
URL: https://svnweb.freebsd.org/changeset/ports/395452

Log:
  Fix sv to check in correct directory.

  /service doesn't play nicely with hier, so keep the old location.

  PR:		ports/202707
  Submitted by:	Sean Chittenden

Changes:
  head/sysutils/runit/Makefile
Comment 2 Chris Rees freebsd_committer freebsd_triage 2015-08-28 08:05:58 UTC
I quite agree.  Really, /var/run/runit/ would perhaps be more correct, but no need for upheaval now!

Thanks very much.
Comment 3 crest 2015-09-08 10:33:48 UTC
This small cleanup job just broke runit for me in a rather nasty way. I stored my services in /service like daemontools and runit did for ages even if it doesn't conform to hier(7). Runit handles dependencies with `sv check $name`. By changing the search directory this commit broke dependencies between services for all existing setups with a /service directory in the name of a minor style cleanup. Please revert the default back to /service or find a way to fall back to /service if /var/service doesn't exist.
Comment 4 Sean Chittenden freebsd_committer freebsd_triage 2015-09-08 17:49:57 UTC
crest@, as a workaround add a symlink from /service to /var/service.

An UPDATING entry was probably warranted for this change.  Here's a first pass:

  AFFECTS: users of sysutils/runit
  AUTHOR: sean@chittenden.org

  The service directory checked by sv(8) has changed from /service to /var/service.

  If the system uses /service, move the contents of /service to /var/service and create a symlink to /var/service:

  mv /service/* /var/service
  rmdir /service
  ln -s /service /var/service

  This change allows the runit startup script and sv(8) to interoperate correctly.