Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jul 2001 22:44:03 -0400
From:      Pete Fritchman <petef@databits.net>
To:        Romain Kang <romain@kzsu.stanford.edu>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: pkg_add puzzlement
Message-ID:  <20010723224403.A3906@databits.net>
In-Reply-To: <200107240121.f6O1L0p17808@kzsu.stanford.edu>; from romain@kzsu.stanford.edu on Mon, Jul 23, 2001 at 06:21:00PM -0700
References:  <200107240121.f6O1L0p17808@kzsu.stanford.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
++ 23/07/01 18:21 -0700 - Romain Kang:
| I've been using this in a PLIST:
| 
| 1 @exec test -d %D/var/run/procstates || mkdir -p %D/var/run/procstates
| 2 @exec chown root.wheel %D/var/run/procstates && chmod 1775 %D/var/run/procstates

[nitpick: you should use chown root:wheel]

| 
| The rationale for each line:
| - 1 Install: make sure that the directory exists, avoiding error messages
|     if an earlier instance of the package is on the machine.

Just curious, but isn't this a bit redundant?  mkdir -p will never
return an error, so you don't have to worry if the directory already
exists.

| - 2 Install: make sure directory has correct permissions.
| 
| For some reason, there are machines where the package is added, but 
| /var/run/procstates does not get created.  pkg_add has no complaints.

I did a real quick test, and noticed the same thing.  But like I said
above, just @exec mkdir -p should do the trick in this case.

-pete

--
Pete Fritchman <petef@databits.net>
Databits Network Services, Inc. <http://databits.net>;
finger petef@databits.net for PGP key


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010723224403.A3906>