From nobody@FreeBSD.org  Sat Oct  5 19:23:08 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id A5AB6466
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  5 Oct 2013 19:23:08 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 77F01218A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  5 Oct 2013 19:23:08 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r95JN8oN040835
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 5 Oct 2013 19:23:08 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r95JN8om040832;
	Sat, 5 Oct 2013 19:23:08 GMT
	(envelope-from nobody)
Message-Id: <201310051923.r95JN8om040832@oldred.freebsd.org>
Date: Sat, 5 Oct 2013 19:23:08 GMT
From: Jason Unovitch <jason.unovitch@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] net/serviio fails to install or upgrade without requiring human intervention to copy -dist config files
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         182711
>Category:       ports
>Synopsis:       [patch] net/serviio fails to install or upgrade without requiring human intervention to copy -dist config files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    netchild
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 05 19:30:00 UTC 2013
>Closed-Date:    Mon Oct 14 19:51:45 UTC 2013
>Last-Modified:  Mon Oct 14 20:00:00 UTC 2013
>Originator:     Jason Unovitch
>Release:        FreeBSD 9.2-RELEASE
>Organization:
N/A
>Environment:
FreeBSD xts-bsd 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
net/serviio's current pkg-plist installs *.dist.properties configuration files upon installation. The administrator must manually copy the distributed config files over so that Serviio can start. Upon a future `pkg upgrade` the files get removed and don't get re-installed, requiring administrator attention once again to replace the files. Serviio's pkg-plist should account for putting default configuration files in place.
>How-To-Repeat:
Install or upgrade net/serviio.  It will need manual attention each time.
>Fix:
Fix the pkg-plist to place default config files in place in a similar manner to what is in the attached patch submission.

Patch attached with submission follows:

--- /root/old-serviio-pkg-plist	2013-10-04 22:33:36.000000000 +0000
+++ /usr/ports/net/serviio/pkg-plist	2013-10-04 22:18:54.000000000 +0000
@@ -41,6 +41,10 @@
 @unexec cmp %D/%%ETCDIR%%/profiles.xml %D/%%ETCDIR%%/profiles.dist.xml && rm -f %D/%%ETCDIR%%/profiles.xml || echo Modified profiles.xml remains in %D/%%ETCDIR%%
 @unexec cmp %D/%%ETCDIR%%/log4j.xml %D/%%ETCDIR%%/log4j.dist.xml && rm -f %D/%%ETCDIR%%/log4j.xml || echo Modified log4j.xml remains in %D/%%ETCDIR%%
 @unexec cmp %D/%%ETCDIR%%/console-log4j.properties %D/%%ETCDIR%%/console-log4j.dist.properties && rm -f %D/%%ETCDIR%%/console-log4j.properties || echo Modified console-log4j.properties remains in %D/%%ETCDIR%%
+@exec [ -f %D/%%ETCDIR%%/application-profiles.xml ] || cp -v %D/%%ETCDIR%%/application-profiles.dist.xml %D/%%ETCDIR%%/application-profiles.xml
+@exec [ -f %D/%%ETCDIR%%/profiles.xml ] || cp -v %D/%%ETCDIR%%/profiles.dist.xml %D/%%ETCDIR%%/profiles.xml
+@exec [ -f %D/%%ETCDIR%%/log4j.xml ] || cp -v %D/%%ETCDIR%%/log4j.dist.xml %D/%%ETCDIR%%/log4j.xml
+@exec [ -f %D/%%ETCDIR%%/console-log4j.properties ] || cp -v %D/%%ETCDIR%%/console-log4j.dist.properties %D/%%ETCDIR%%/console-log4j.properties
 %%ETCDIR%%/profiles.dist.xml
 %%ETCDIR%%/log4j.dist.xml
 %%ETCDIR%%/application-profiles.dist.xml


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->netchild 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Oct 5 19:30:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182711 
State-Changed-From-To: open->closed 
State-Changed-By: netchild 
State-Changed-When: Mon Oct 14 19:51:33 UTC 2013 
State-Changed-Why:  
Committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182711 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/182711: commit references a PR
Date: Mon, 14 Oct 2013 19:50:40 +0000 (UTC)

 Author: netchild
 Date: Mon Oct 14 19:50:26 2013
 New Revision: 330348
 URL: http://svnweb.freebsd.org/changeset/ports/330348
 
 Log:
   - give serviio a home (other than what is specified in the GECOS of the user)
   - generate a set of config files from the example ones, if no config file
     exists (on first install or if the config didn't change from the example
     one) [1]
   
   PR:		182711 [1]
   Submitted by:	Jason Unovitch <jason.unovitch@gmail.com> [1]
 
 Modified:
   head/net/serviio/Makefile
   head/net/serviio/files/serviio.in
   head/net/serviio/files/serviiod.in
   head/net/serviio/pkg-plist
 
 Modified: head/net/serviio/Makefile
 ==============================================================================
 --- head/net/serviio/Makefile	Mon Oct 14 19:48:49 2013	(r330347)
 +++ head/net/serviio/Makefile	Mon Oct 14 19:50:26 2013	(r330348)
 @@ -3,7 +3,7 @@
  
  PORTNAME=	serviio
  PORTVERSION=	1.3.1
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	net multimedia java www
  MASTER_SITES=	http://download.serviio.org/releases/
  EXTRACT_SUFX=	-linux.tar.gz
 
 Modified: head/net/serviio/files/serviio.in
 ==============================================================================
 --- head/net/serviio/files/serviio.in	Mon Oct 14 19:48:49 2013	(r330347)
 +++ head/net/serviio/files/serviio.in	Mon Oct 14 19:50:26 2013	(r330348)
 @@ -24,7 +24,7 @@ if [ -n "${serviio_lang}" ]; then
  	export LANG=${serviio_lang}
  fi
  
 -_dirs="/var/db/serviio /var/log/serviio"
 +_dirs="/var/db/serviio /var/db/serviio/home /var/log/serviio"
  start_precmd="mkdir -p $_dirs; chown $serviio_user $_dirs"
  command_args="$serviio_args &"
  
 
 Modified: head/net/serviio/files/serviiod.in
 ==============================================================================
 --- head/net/serviio/files/serviiod.in	Mon Oct 14 19:48:49 2013	(r330347)
 +++ head/net/serviio/files/serviiod.in	Mon Oct 14 19:50:26 2013	(r330348)
 @@ -6,6 +6,7 @@
  ### ====================================================================== ###
  
  PATH=$PATH:%%PREFIX%%/bin
 +HOME=/var/db/serviio/home
  SERVIIO_HOME=%%JAVAJARDIR%%/serviio
  SERVIIO_CLASS_PATH="$SERVIIO_HOME/serviio.jar"
  # Setup the classpath
 @@ -16,7 +17,7 @@ done
  SERVIIO_CLASS_PATH="$SERVIIO_CLASS_PATH:%%ETCDIR%%"
  
  # Setup Serviio specific properties
 -JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=/var/db/serviio -Dserviio.home=$SERVIIO_HOME -Dffmpeg.location=%%LOCALBASE%%/bin/ffmpeg1"
 +JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=/var/db/serviio -Dserviio.home=$HOME -Dffmpeg.location=%%LOCALBASE%%/bin/ffmpeg1"
  JAVA_OPTS="${JAVA_OPTS} -Djcs.auxiliary.DC.attributes.DiskPath=/var/db/serviio"
  
  
 @@ -31,4 +32,5 @@ do
  done
  
  # Execute the JVM in the foreground
 +export HOME PATH
  exec java -Xmx512M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@" 2>&1 >/dev/null
 
 Modified: head/net/serviio/pkg-plist
 ==============================================================================
 --- head/net/serviio/pkg-plist	Mon Oct 14 19:48:49 2013	(r330347)
 +++ head/net/serviio/pkg-plist	Mon Oct 14 19:50:26 2013	(r330348)
 @@ -41,6 +41,10 @@ bin/serviio-console
  @unexec cmp %D/%%ETCDIR%%/profiles.xml %D/%%ETCDIR%%/profiles.dist.xml && rm -f %D/%%ETCDIR%%/profiles.xml || echo Modified profiles.xml remains in %D/%%ETCDIR%%
  @unexec cmp %D/%%ETCDIR%%/log4j.xml %D/%%ETCDIR%%/log4j.dist.xml && rm -f %D/%%ETCDIR%%/log4j.xml || echo Modified log4j.xml remains in %D/%%ETCDIR%%
  @unexec cmp %D/%%ETCDIR%%/console-log4j.properties %D/%%ETCDIR%%/console-log4j.dist.properties && rm -f %D/%%ETCDIR%%/console-log4j.properties || echo Modified console-log4j.properties remains in %D/%%ETCDIR%%
 +@exec [ -f %D/%%ETCDIR%%/application-profiles.xml ] || cp -v %D/%%ETCDIR%%/application-profiles.dist.xml %D/%%ETCDIR%%/application-profiles.xml
 +@exec [ -f %D/%%ETCDIR%%/profiles.xml ] || cp -v %D/%%ETCDIR%%/profiles.dist.xml %D/%%ETCDIR%%/profiles.xml
 +@exec [ -f %D/%%ETCDIR%%/log4j.xml ] || cp -v %D/%%ETCDIR%%/log4j.dist.xml %D/%%ETCDIR%%/log4j.xml
 +@exec [ -f %D/%%ETCDIR%%/console-log4j.properties ] || cp -v %D/%%ETCDIR%%/console-log4j.dist.properties %D/%%ETCDIR%%/console-log4j.properties
  %%ETCDIR%%/profiles.dist.xml
  %%ETCDIR%%/log4j.dist.xml
  %%ETCDIR%%/application-profiles.dist.xml
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
