Date: Wed, 12 Sep 2012 08:50:24 GMT From: Norbert Koch <nkoch@demig.de> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/171568: [patch] sysutils/hal: recreate hal direcories Message-ID: <201209120850.q8C8oOh7070966@red.freebsd.org> Resent-Message-ID: <201209120900.q8C90Apg013053@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 171568 >Category: ports >Synopsis: [patch] sysutils/hal: recreate hal direcories >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Sep 12 09:00:10 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Norbert Koch >Release: 9.0 >Organization: >Environment: >Description: hald won't run with varmfs="YES" due to non-existent directories when talking to PolicyKit. >How-To-Repeat: set varmfs="YES" and populate_var="YES" and reboot. hald won't run. Try hald --daemon=no --verbose=yes hald reports an error with PolicyKit. >Fix: This is a quick hack as I do not know anything about hald's requirements/internals: I just copied what I found in the package install scripts of Policykit, polkit, ConsoleKit, hal into rc.d/hald. Patch attached with submission follows: --- /usr/local/etc/rc.d/hald 2012-08-24 11:44:57.000000000 +0200 +++ hald 2012-09-06 17:25:10.000000000 +0200 @@ -41,6 +41,43 @@ return 0 } +init_policykit() +{ + local USER=polkit + local GROUP=${USER} + local PREFIX=/usr/local + + /usr/bin/install -d -o root -m 0770 -g ${GROUP} /var/run/PolicyKit + /usr/bin/install -d -o root -m 0770 -g ${GROUP} /var/lib/PolicyKit + /usr/bin/install -d -o ${USER} -m 0755 -g wheel /var/lib/PolicyKit-public + /bin/mkdir -p /var/lib/misc + /usr/bin/touch -f /var/lib/misc/PolicyKit.reload + /usr/sbin/chown ${USER}:${GROUP} /var/lib/misc/PolicyKit.reload + /bin/chmod 0664 /var/lib/misc/PolicyKit.reload +} + +init_polkit() +{ + mkdir -p /var/lib/polkit-1/localauthority + for i in 10-vendor.d 20-org.d 30-site.d 50-local.d 90-mandatory.d + do + mkdir -p /var/lib/polkit-1/localauthority/${i} + done + chmod 0700 /var/lib/polkit-1 +} + +init_hal() +{ + local USER=haldaemon + local GROUP=${USER} + + /usr/bin/install -d -o ${USER} -g ${GROUP} /var/run/hald + /usr/bin/install -d -o ${USER} -g ${GROUP} /var/cache/hald + /usr/bin/install -d -o ${USER} -g ${GROUP} /var/lib/hal + /usr/local/bin/polkit-auth --user ${USER} --grant \ + org.freedesktop.policykit.read +} + hald_precmd() { if ! checkyesno dbus_enable @@ -48,6 +85,10 @@ local_force_depend dbus || return 1 fi + init_policykit + init_polkit + init_hal + chmod 0755 /var/cache mkdir -p $(dirname $pidfile) >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209120850.q8C8oOh7070966>