Skip to content
Permalink
Browse files

- Be more aggressive about creating launchd plists as root:wheel.

- Declare UI_PREFIX before using it.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@14482 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
jdberry committed Oct 8, 2005
1 parent 1e348e4 commit 75ca98c5b8b39f078f82cbe3464571149ad929e3
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/port1.0/portstartupitem.tcl
@@ -1,7 +1,7 @@
# et:ts=4
# portstartupitem.tcl
#
# $Id: portstartupitem.tcl,v 1.16 2005/10/08 19:01:54 jberry Exp $
# $Id: portstartupitem.tcl,v 1.17 2005/10/08 19:21:02 jberry Exp $
#
# Copyright (c) 2004, 2005 Markus W. Weissman <mww@opendarwin.org>,
# Copyright (c) 2005 Robert Shaw <rshaw@opendarwin.org>,
@@ -116,7 +116,7 @@ proc startupitem_create_rcng {args} {
}

proc startupitem_create_darwin_systemstarter {args} {
global prefix destroot destroot.keepdirs portname os.platform
global UI_PREFIX prefix destroot destroot.keepdirs portname os.platform
global startupitem.name startupitem.requires startupitem.init
global startupitem.start startupitem.stop startupitem.restart startupitem.executable
global startupitem.pidfile startupitem.logfile startupitem.logevents
@@ -370,7 +370,7 @@ RunService "$1"
}

proc startupitem_create_darwin_launchd {args} {
global prefix destroot destroot.keepdirs portname os.platform
global UI_PREFIX prefix destroot destroot.keepdirs portname os.platform
global startupitem.name startupitem.requires startupitem.init
global startupitem.start startupitem.stop startupitem.restart startupitem.executable
global startupitem.pidfile startupitem.logfile startupitem.logevents
@@ -387,6 +387,7 @@ proc startupitem_create_darwin_launchd {args} {
]

file mkdir ${destroot}${itemdir}
file attributes ${destroot}${itemdir} -owner root -group wheel

if { [llength ${startupitem.executable}] &&
![llength ${startupitem.init}] &&
@@ -424,6 +425,7 @@ proc startupitem_create_darwin_launchd {args} {

# Create the wrapper script
set item [open "${destroot}${wrapper}" w 0755]
file attributes "${destroot}${wrapper}" -owner root -group wheel

puts ${item} "#!/bin/sh"
puts ${item} "#"
@@ -509,7 +511,7 @@ proc startupitem_create_darwin_launchd {args} {
set pidFile [lindex ${startupitem.pidfile} 1]
}

if { ${pidfileArgCnt} != 2 } {
if { ${pidfileArgCnt} > 2 } {
ui_error "$UI_PREFIX [msgcat::mc "Invalid parameter count to startupitem.pidfile: 2 expected, %d found" ${pidfileArgCnt}]"
}

0 comments on commit 75ca98c

Please sign in to comment.
You can’t perform that action at this time.