Bug 148185 - [patch] port devel/viewvc update to 1.1.6
Summary: [patch] port devel/viewvc update to 1.1.6
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Greg Larkin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-27 14:20 UTC by Olli Hauer
Modified: 2010-07-07 19:20 UTC (History)
1 user (show)

See Also:


Attachments
patch_viewvc.txt (2.13 KB, text/plain)
2010-06-27 14:20 UTC, Olli Hauer
no flags Details
patch_viewvc-1.1.6_plus_notes_on_standalone.txt (2.49 KB, text/plain)
2010-07-02 14:49 UTC, Olli Hauer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olli Hauer 2010-06-27 14:20:03 UTC
Update viewvc to 1.1.6
remove files/patch-lib__sapi.py (fixed in this version)
change LOCAL/pgollucci to LOCAL/glarkin

@glarkin
can you place the viewvc tar file into your FreeBSD space?
download is broken with fetch since a view version.
As second download option I can change fetch to wget but I don't prefer this.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-06-27 14:20:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->glarkin

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Greg Larkin freebsd_committer freebsd_triage 2010-06-30 16:10:24 UTC
State Changed
From-To: open->analyzed

Working on fixing some other problems with the port, 
including process daemonization in the viewvc rc.d script.
Comment 3 Olli Hauer 2010-07-02 14:49:16 UTC
> 
> Hi Olli,
> 
> Thanks very much for the patch, and I have been working on integrating
> it today.  I found a simple download URL here:
> http://www.viewvc.org/viewvc-1.1.6.tar.gz, and I will still add it to my
> local download space.
> 
> I haven't looked at the port since adopting it, but I'm also fixing a
> lot of spelling and grammatical errors in the messages, cleaning up
> OPTIONS, etc.
> 
> One final problem I'm working on is the rc.d script for standalone mode.
>  It doesn't properly create a daemon when running standalone.py, and
> standalone.py itself doesn't daemonize correctly.  FreeBSD has
> /usr/sbin/daemon for this purpose, but it doesn't function well in this
> case.  I may integrate this module
> (http://svn.silfreed.net/jolem/trunk/pyDaemon.py) to daemonize viewvc
> correctly.
> 


Hi Greg,

I've done some testing with the standalone.py and found why I hasn't
worked during the quick test in my case.
Issue was I had in viewvc.conf some sections with [vhosts] and this
cannot handled by standalone.py

A quick test showed the standalone.py is working if there are no
entries in viewvc.conf that the standalone.py do not understand.

I changed viewvc.in to reflect latest changes (has now a param -d)
Please check if the attached patch is working for you.
Feel free to cleanup my bad english ;)


To test standalone.py try the following
- install viewvc with standalone enabled

file: /etc/rc.conf.local
viewvc_enable="YES"
viewvc_flags="-h MyHostName -c /usr/local/viewvc/viewvc_standalone.conf"

file: /usr/local/viewvc/viewvc_standalone.conf
[general]
root_parents = /repos/subversion/svnroot : svn
[utilities]
[options]
[templates]
[cvsdb]
[vhosts]
[authz-forbidden]
[authz-forbiddenre]
[authz-svnauthz]


(change sample paths to match your environ)


Regards,
olli
Comment 4 Greg Larkin freebsd_committer freebsd_triage 2010-07-06 23:21:42 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

olli hauer wrote:

> Hi Greg,
> 
> I've done some testing with the standalone.py and found why I hasn't
> worked during the quick test in my case.
> Issue was I had in viewvc.conf some sections with [vhosts] and this
> cannot handled by standalone.py
> 
> A quick test showed the standalone.py is working if there are no
> entries in viewvc.conf that the standalone.py do not understand.
> 
> I changed viewvc.in to reflect latest changes (has now a param -d)
> Please check if the attached patch is working for you.
> Feel free to cleanup my bad english ;)
> 
> 
> To test standalone.py try the following
> - install viewvc with standalone enabled
> 
> file: /etc/rc.conf.local
> viewvc_enable="YES"
> viewvc_flags="-h MyHostName -c /usr/local/viewvc/viewvc_standalone.conf"
> 
> file: /usr/local/viewvc/viewvc_standalone.conf
> [general]
> root_parents = /repos/subversion/svnroot : svn
> [utilities]
> [options]
> [templates]
> [cvsdb]
> [vhosts]
> [authz-forbidden]
> [authz-forbiddenre]
> [authz-svnauthz]
> 
> 
> (change sample paths to match your environ)
> 
> 
> Regards,
> olli
> 
> 

Hi Olli,

Thank you for the patch, and I have run some more tests here.
Unfortunately, the -d flag for standalone.py doesn't properly daemonize
the process into a true server.  The issue is that python is not
detached from the controlling terminal, as a daemon should be.

As an example, here is the output from "ps uaxww | grep viewvc" when
viewvc is started from the current rc.d script:

www      15256  0.5  1.1 10684  8404  p0  S     5:59PM   0:00.02
/usr/local/bin/python2.6 /usr/local/viewvc/bin/standalone.py -h
fbsd70.entropy.prv -c /usr/local/viewvc/viewvc_standalone.conf -d

The tty is "p0" - the terminal where I started the server.  Here's the
output of the same command when the server is started with daemon(8):

# daemon -cf -u www /usr/local/bin/python2.6
/usr/local/viewvc/bin/standalone.py -c
/usr/local/viewvc/viewvc_standalone.conf

# ps uaxww | grep viewvc
www     16104  9.7  1.1 10684  8392  ??  Ss    6:03PM   0:00.21
/usr/local/bin/python2.6 /usr/local/viewvc/bin/standalone.py -c
/usr/local/viewvc/viewvc_standalone.conf

Here, the tty is "??", indicating that the process has detached from the
controlling terminal.

Unfortunately, I can't configure the variables in /etc/rc.conf and the
viewvc.in file correctly to produce the daemon(8) command-line above.
I'm working on some alternatives, and I'll keep you posted.

Thank you,
Greg
- --
Greg Larkin

http://www.FreeBSD.org/           - The Power To Serve
http://www.sourcehosting.net/     - Ready. Set. Code.
http://twitter.com/sourcehosting/ - Follow me, follow you
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFMM6x20sRouByUApARAvcfAJwKdbUIO7rImtyd3zPyZ/ebog+/IQCfZu0s
W8GbRS0ofKQU0VocHrbArEU=
=xVEx
-----END PGP SIGNATURE-----
Comment 5 Olli Hauer 2010-07-07 17:08:00 UTC
Hi Greg,

I think the following script will do what you want.
It use the daemon util to start and detach the script from the console.
To protect someone to use additional parameter -d in viewvc_flags I added a precmd
to find the '-d' param. The reason to test for this param is we get another pid if
this param is used.

The following rc.conf examples are working
(no change for users who update except If they had param -d)

file: /etc/rc.conf.local
viewvc_enable="YES" 

1)
no viewvc_flags => OK, only localhost listening on port 49152

2)
viewvc_flags="-h MyHostName -p 8000 -c /usr/local/viewvc/viewvc_standalone.conf"

My mistake in the last check was I have per-root overrides in viewvc.conf so I need
a dedicated for standalone (I closed the Bug ID 459 on tigris)

sample ps output with the new script:
www      96261  0.0  0.3 10748  7696  ??  Ss    6:02pm   0:00.15 /usr/local/bin/python2.6 /usr/local/viewvc/bin/standalone.py -p 49152


Regards,
olli


--- viewvc.sh.in.txt begins here ---
#!/bin/sh

# $FreeBSD: ports/devel/viewvc/files/viewvc.in,v 1.3 2010/03/27 00:12:53 dougb Exp $
#
# PROVIDE: viewvc
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable ViewVC:
#
#  viewvc_enable="YES"
#  # optional
#  viewvc_flags="-h localhost -p PORT"
#  viewvc_user="www"
#
# To get aviable parameters and the default values use the 
# command /usr/local/viewvc/bin/standalone.py --help 
# for more info.
#
# Note:
# If you choose a listen port less then 1024 then you have 
# to use a privileged user.
# If the user www can not access your cvs/svn repository 
# adust the parameter viewvc_user and it should work.
#
# INFO:
# The default port will change with the next release of ViewVC
# from 7467 to 49152
# see http://viewvc.tigris.org/issues/show_bug.cgi?id=234

. "/etc/rc.subr"

name="viewvc"
rcvar=${name}_enable
load_rc_config $name

# Set defaults
viewvc_enable=${viewvc_enable:-"NO"}
viewvc_flags=${viewvc_flags:-"-p 49152"}
viewvc_user=${viewvc_user:-"www"}

pidfile=/var/run/viewvc.pid
command="%%PYTHON_CMD%%"
standalone="%%INSTDIR%%/bin/standalone.py"

start_precmd="viewvc_precmd"
start_cmd="viewvc_start"
stop_postcmd="viewvc_cleanup"

viewvc_precmd()
{
    # with param -d we get another pid so prevent this
	echo "${viewvc_flags}" | egrep -q "(^\-d| \-d)" 2>&1 > /dev/null
	if [ $? -eq 0 ]; then
        echo "Please remove parameter -d from viewvc_flags"
        echo ""
        return 1
	fi
}

viewvc_start() {
        echo "starting viewvc standalone"
        touch ${pidfile} && chown ${viewvc_user} ${pidfile}
        daemon -f -p ${pidfile} -u ${viewvc_user} -c ${standalone} ${viewvc_flags}
}

viewvc_cleanup() {
	[ -f ${pidfile} ] && /bin/rm ${pidfile}
}

run_rc_command "$1"
--- viewvc.sh.in.txt ends here ---
Comment 6 dfilter service freebsd_committer freebsd_triage 2010-07-07 19:03:36 UTC
glarkin     2010-07-07 18:03:21 UTC

  FreeBSD ports repository

  Modified files:
    devel/viewvc         Makefile distinfo pkg-plist 
    devel/viewvc/files   pkg-message.in viewvc.in 
  Removed files:
    devel/viewvc/files   patch-lib__sapi.py 
  Log:
  - Updated to 1.1.6
  - Modified rc.d script for standalone mode so it daemonizes properly
  - Changed a MASTER_SITES entry
  
  PR:             ports/148185
  Submitted by:   olli hauer <ohauer at gmx dot de>
  Feature safe:   yes
  
  Revision  Changes    Path
  1.49      +13 -13    ports/devel/viewvc/Makefile
  1.22      +3 -3      ports/devel/viewvc/distinfo
  1.2       +0 -10     ports/devel/viewvc/files/patch-lib__sapi.py (dead)
  1.6       +13 -17    ports/devel/viewvc/files/pkg-message.in
  1.4       +42 -22    ports/devel/viewvc/files/viewvc.in
  1.12      +3 -0      ports/devel/viewvc/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 dfilter service freebsd_committer freebsd_triage 2010-07-07 19:09:31 UTC
glarkin     2010-07-07 18:09:23 UTC

  FreeBSD doc repository (ports committer)

  Modified files:
    en_US.ISO8859-1/articles/contributors contrib.additional.sgml 
  Log:
  - Add long-overdue contributor entry for Olli Hauer
  
  PR:             ports/148185
  Feature safe:   yes
  
  Revision  Changes    Path
  1.926     +5 -0      doc/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 8 Greg Larkin freebsd_committer freebsd_triage 2010-07-07 19:09:51 UTC
State Changed
From-To: analyzed->closed

Committed, thank you!