Bug 191536

Summary: [PATCH] devel/zookeeper rc.d script do not starts when running using /usr/sbin/service
Product: Ports & Packages Reporter: Radim Kolar <hsn>
Component: Individual Port(s)Assignee: Steven Kreuzer <skreuzer>
Status: Closed FIXED    
Severity: Affects Only Me CC: hsn, skreuzer
Priority: ---    
Version: Latest   
Hardware: i386   
OS: Any   
Attachments:
Description Flags
patch for fixing problem
none
patch for port none

Description Radim Kolar 2014-07-01 20:51:29 UTC
OS - FreeBSD 10-STABLE/ i386

there is bug in rc.d start script, it requires /usr/local/bin in path which is not set when using `/sbin/service` helper

root@sanatana:~ # service zookeeper onestart
env: bash: No such file or directory
root@sanatana:~ # whereis bash
bash: /usr/local/bin/bash /usr/local/man/man1/bash.1.gz /usr/ports/shells/bash

it is caused that service script sets path not including local:

root@sanatana:~ # sh -x /usr/sbin/service zookeeper onestart
[---cut---]
+ [ -x /etc/rc.d/zookeeper ]
+ [ -x /usr/local/etc/rc.d/zookeeper ]
+ [ -n '' ]
+ exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin /usr/local/etc/rc.d/zookeeper onestart
env: bash: No such file or directory

Problem 2:

%%ZOOKEEPER_LOGDIR%% and %%ZOKEEPER_RUNDIR%% are not replaced in rc.d script
Comment 1 Radim Kolar 2014-07-01 22:03:58 UTC
Created attachment 144325 [details]
patch for fixing problem

patch tested on FreeBSD 10
Comment 2 Radim Kolar 2014-07-02 10:21:03 UTC
Created attachment 144332 [details]
patch for port

Patch improved:

- added ability to disable JMX in zookeeper by setting zookeeper_jmx=NO
- link to command line client zkCli.sh added to ${PREFIX}/bin
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-07-22 15:25:57 UTC
A commit references this bug:

Author: skreuzer
Date: Tue Jul 22 15:25:14 UTC 2014
New revision: 362548
URL: http://svnweb.freebsd.org/changeset/ports/362548

Log:
  Fix issue preventing zookeeper from starting when using service(8)
  Add ability to disable JMX in zookeeper by setting zookeeper_jmx=NO
  Link to command line client zkCli.sh added to ${PREFIX}/bin

  PR:		191536
  Submitted by:	Radim Kolar <hsn@sendmail.cz>

Changes:
  head/devel/zookeeper/Makefile
  head/devel/zookeeper/files/zookeeper.in
  head/devel/zookeeper/pkg-plist