pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/50075 (Making dbus actually work on FreeBSD, DragonFly, and probably more)



The following reply was made to PR pkg/50075; it has been noted by GNATS.

From: David Shao <davshao%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/50075 (Making dbus actually work on FreeBSD, DragonFly, and
 probably more)
Date: Mon, 7 Sep 2015 22:23:15 -0700

 These are the final patches whose goal is to support my perhaps
 unhealthy practice of switching between dports and pkgsrc in DragonFly
 on the same machine.
 
 Crashes are not unknown so I like to have checks to clean out dbus's
 pidfile both when the daemon is stopped and before it starts.  Also
 when switching between dports and pkgsrc, I delete the /var/db/dbus
 directory as it has ownership with different dbus owners depending on
 dports vs pkgsrc; therefore, I need to check whether it needs to be
 re-created before the dbus daemon starts.
 
 There might have to be an option in options.mk so that both non-root
 installs of dbus and installs using /var can properly configure dbus's
 user and group, in particular, the need or no need for the dbus user
 home directory.
 
 diff -Nurb dbus.user/CVS/Entries dbus/CVS/Entries
 --- dbus.user/CVS/Entries    2015-09-07 14:20:29.747373000 -0700
 +++ dbus/CVS/Entries    2015-09-07 20:47:02.315968000 -0700
 @@ -3,11 +3,10 @@
  /INSTALL/1.1/Wed Sep 24 11:37:31 2008//
  /MESSAGE/1.2/Tue Dec  2 05:20:24 2014//
  /MESSAGE.launchd/1.1/Wed Jan 21 05:38:59 2015//
 -/Makefile/1.86/Sun Aug 30 15:08:00 2015//
 +/Makefile/1.87/Mon Sep  7 23:24:46 2015//
 +/PLIST/1.20/Sun Aug 30 15:08:00 2015//
  /buildlink3.mk/1.16/Wed Jan 29 13:01:53 2014//
  /distinfo/1.66/Sun Aug 30 15:08:00 2015//
  /hacks.mk/1.3/Tue Feb  5 22:03:57 2008//
 -/options.mk/1.8/Wed Jan 21 13:45:18 2015//
 -D/files////
 -D/patches////
 -/PLIST/1.20/Mon Sep  7 21:20:29 2015//
 +/options.mk/1.9/Mon Sep  7 23:24:46 2015//
 +D
 diff -Nurb dbus.user/CVS/Entries.Log dbus/CVS/Entries.Log
 --- dbus.user/CVS/Entries.Log    1969-12-31 16:00:00.000000000 -0800
 +++ dbus/CVS/Entries.Log    2015-09-07 20:47:02.355968000 -0700
 @@ -0,0 +1,2 @@
 +A D/files////
 +A D/patches////
 diff -Nurb dbus.user/Makefile dbus/Makefile
 --- dbus.user/Makefile    2015-09-07 18:52:16.625900000 -0700
 +++ dbus/Makefile    2015-09-07 21:42:06.923074000 -0700
 @@ -32,9 +32,7 @@
 
  CONFIGURE_ARGS+=    --localstatedir=${VARBASE:Q}
 
 -CONFIGURE_ARGS_GROUPS=    enable disable with without
 -
 -.if ${OPSYS} == "Darwin"
 +.if ${OPSYS} == "Darwin" || ${OPSYS} == "DragonFly" || ${OPSYS} == "FreeBSD"
  # Prevent the configure script from picking up a per-user tmp
  # directory. See the commit message on revision 1.35
  CONFIGURE_ARGS+=    --with-session-socket-dir=/tmp
 @@ -78,7 +76,9 @@
  PKG_GROUPS=        ${DBUS_GROUP}
  PKG_USERS=        ${DBUS_USER}:${DBUS_GROUP}
  PKG_GECOS.${DBUS_USER}=    System message bus
 -PKG_HOME.${DBUS_USER}=    ${VARBASE}/run/dbus
 +# Modern dbus does not need a home directory for its user
 +# Or should this be moved to being an option?
 +# PKG_HOME.${DBUS_USER}=    ${VARBASE}/run/dbus
 
  FILES_SUBST+=        DBUS_USER_SH=${DBUS_USER}
  FILES_SUBST+=        DBUS_GROUP_SH=${DBUS_GROUP}
 diff -Nurb dbus.user/files/dbus.sh dbus/files/dbus.sh
 --- dbus.user/files/dbus.sh    2015-09-07 19:10:12.806257000 -0700
 +++ dbus/files/dbus.sh    2015-09-07 21:04:21.423462000 -0700
 @@ -13,17 +13,29 @@
  command="@PREFIX@/bin/dbus-daemon"
  command_args="--system"
  pidfile="@VARBASE@/run/dbus/@DBUS_SYSTEM_PID_FILE_SH@"
 -start_precmd=dbus_prestart
 +start_precmd="dbus_prestart"
 +stop_postcmd="dbus_poststop"
 
  dbus_prestart() {
 +    dbdir="@VARBASE@/db/dbus"
 +    if @TEST@ ! -d $dbdir; then
 +        @MKDIR@ $dbdir
 +    fi
      dir="@VARBASE@/run/dbus"
      if @TEST@ ! -d $dir; then
          @MKDIR@ $dir
 -        @CHMOD@ 0755 $dir
 -        @CHOWN@ @DBUS_USER_SH@:@DBUS_GROUP_SH@ $dir
 +# On other systems /var/run/dbus root:wheel works fine
 +#        @CHMOD@ 0755 $dir
 +#        @CHOWN@ @DBUS_USER_SH@:@DBUS_GROUP_SH@ $dir
 +    elif @TEST@ -f $pidfile; then
 +        @RM@ -f $pidfile
      fi
      @PREFIX@/bin/dbus-uuidgen --ensure
  }
 
 +dbus_poststop() {
 +    @RM@ -f $pidfile
 +}
 +
  load_rc_config $name
  run_rc_command "$1"
 


Home | Main Index | Thread Index | Old Index