Bug 179487 - [PATCH] net/minidlna: minidlna-1.1.0,1 does not create pid directory
Summary: [PATCH] net/minidlna: minidlna-1.1.0,1 does not create pid directory
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: William Grzybowski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-11 13:40 UTC by Bernard Spil
Modified: 2015-03-06 09:34 UTC (History)
0 users

See Also:


Attachments
file.diff (444 bytes, patch)
2013-06-11 13:40 UTC, Bernard Spil
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard Spil freebsd_committer freebsd_triage 2013-06-11 13:40:00 UTC
After upgrading minidlna from minidlna-1.0.25_1,1 to the latest version, it fails to start with the message

/usr/local/etc/rc.d/minidlna: WARNING: /var/run/minidlna is not a directory.
/usr/local/etc/rc.d/minidlna: WARNING: failed precmd routine for minidlna

How-To-Repeat: Upgrade minidlna-1.0.25_1,1 to minidlna-1.1.0,1
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-17 02:03:57 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wg

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 William Grzybowski 2013-06-17 02:42:25 UTC
That patch does not make sense, it installs a dir using unexistent
users (minidlna).

Also there is already a MKDIR command in Makefile post-install.

You error seems to indicated you have a file already created called
/var/run/minidlna, how is that possible?

--
William Grzybowski
------------------------------------------
Curitiba/PR - Brasil
Comment 3 Bernard Spil freebsd_committer freebsd_triage 2013-06-19 20:46:36 UTC
Hi William,

Sorry for that, looks like a package problem only. I ran into trouble
after the upgrade using a package that minidlna wouldn't start due to
the fact that the /var/run/minidlna directory did not exist.

from rc.d/minidlna
pidfile="/var/run/minidlna/minidlna.pid"

start_precmd="rm -f $pidfile"
stop_postcmd=$start_precmd

That's why it complained
/usr/local/etc/rc.d/minidlna: WARNING: /var/run/minidlna is not a directory.
/usr/local/etc/rc.d/minidlna: WARNING: failed precmd routine for minidlna

There was still an old minidlna.pid
-rw-r--r--  1 root  wheel  6 Mar 17 15:53 /var/run/minidlna.pid

Re-built and packaged minidlna-1.1.0,1 and it still fails, and no pid
dir is created
ls: /var/run/minidlna*: No such file or directory

Building and installing does create the /var/run/minidlna dir so a
package-only problem, hence I modified the pkg-plist using an example
from fetchmail(?)

Kind regards,

Spil.

On Mon, Jun 17, 2013 at 3:42 AM, William Grzybowski <william88@gmail.com> wrote:
> That patch does not make sense, it installs a dir using unexistent
> users (minidlna).
>
> Also there is already a MKDIR command in Makefile post-install.
>
> You error seems to indicated you have a file already created called
> /var/run/minidlna, how is that possible?
>
> --
> William Grzybowski
> ------------------------------------------
> Curitiba/PR - Brasil
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-06-19 21:35:10 UTC
Author: wg
Date: Wed Jun 19 20:34:57 2013
New Revision: 321321
URL: http://svnweb.freebsd.org/changeset/ports/321321

Log:
  net/minidlna: fix run dir for packages
  
  - Use rc.d script to install /var/{db,run}/minidlna as precmd
  - Fix order (rclint)
  
  PR:		ports/179487
  Submitted by:	crees
  Approved by:	culot / jpaetzel (mentors, implicit)

Modified:
  head/net/minidlna/Makefile
  head/net/minidlna/files/minidlna.in

Modified: head/net/minidlna/Makefile
==============================================================================
--- head/net/minidlna/Makefile	Wed Jun 19 20:12:38 2013	(r321320)
+++ head/net/minidlna/Makefile	Wed Jun 19 20:34:57 2013	(r321321)
@@ -49,9 +49,6 @@ post-install:
 	${INSTALL_MAN} ${MAN5:S,^,${WRKSRC}/,} ${MANPREFIX}/man/man5/
 	${INSTALL_MAN} ${MAN8:S,^,${WRKSRC}/,} ${MANPREFIX}/man/man8/
 	${INSTALL_DATA} ${WRKSRC}/minidlna.conf ${PREFIX}/etc/minidlna.conf.sample
-	@${MKDIR} /var/run/minidlna
-	@${MKDIR} /var/db/minidlna
-	@${CHOWN} ${USERS} /var/db/minidlna
 	@${FMT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>

Modified: head/net/minidlna/files/minidlna.in
==============================================================================
--- head/net/minidlna/files/minidlna.in	Wed Jun 19 20:12:38 2013	(r321320)
+++ head/net/minidlna/files/minidlna.in	Wed Jun 19 20:34:57 2013	(r321321)
@@ -1,4 +1,5 @@
 #!/bin/sh
+#
 # $FreeBSD$
 #
 # PROVIDE: minidlna
@@ -13,21 +14,21 @@
 
 name=minidlna
 rcvar=minidlna_enable
-command=%%PREFIX%%/sbin/minidlnad
 
 load_rc_config $name
 
 minidlna_enable=${minidlna_enable-"NO"}
 minidlna_uid=${minidlna_uid-"%%USER%%"}
 
+command=%%PREFIX%%/sbin/minidlnad
 pidfile="/var/run/minidlna/minidlna.pid"
+command_args="-P $pidfile -u $minidlna_uid -f %%PREFIX%%/etc/minidlna.conf"
+required_dirs="/var/run/minidlna /var/db/minidlna"
 
-start_precmd="rm -f $pidfile"
-stop_postcmd=$start_precmd
+start_precmd="install -d -o $minidlna_uid ${pidfile%/*} /var/db/minidlna"
+stop_postcmd="rm -f $pidfile"
 
-command_args="-P $pidfile -u $minidlna_uid -f %%PREFIX%%/etc/minidlna.conf"
 extra_commands=rescan
 rescan_cmd="$command -R -u $minidlna_uid -f %%PREFIX%%/etc/minidlna.conf"
-required_dirs="/var/run/minidlna /var/db/minidlna"
 
 run_rc_command $1
_______________________________________________
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"
Comment 5 William Grzybowski freebsd_committer freebsd_triage 2013-06-19 21:35:18 UTC
State Changed
From-To: open->closed

Should be fixed, thanks.