edit /etc/nsswitch.conf

Moritz Warning moritzwarning at web.de
Fri Nov 21 22:54:00 UTC 2014


ok thanks, I did not know pkg-install.

On 11/21/2014 11:39 PM, Scot Hetzel wrote:
> On Fri, Nov 21, 2014 at 2:36 PM, Moritz Warning <moritzwarning at web.de> wrote:
>> Hi,
>>
>> I try to write a port of an application that needs to edit /etc/nsswitch.conf.
>> But I have trouble modifying /etc/nsswitch.conf in pkg-plist (there is where it should be done?).
>> Even creating a test file in pkg-plist seem be ignored:
>>
>> /etc/testfile
>> @exec echo 'test' >> /etc/testfile
>>
>> Any ideas what could be wrong?
>>
> You probably don't want to do this in the pkg-plist, instead you would
> normally do this in pkg-install:
> 
> 
> pkg-install
> #!/bin/sh
> 
> PKG_BATCH=${BATCH:=NO}
> PKG_PREFIX=${PKG_PREFIX:=/usr/local}
> 
> case $2 in
>         POST-INSTALL)
>                                       if [ "${PKG_BATCH}" = "NO" ]; then
>                                           # Do something to add an
> entry to /etc/nsswitch.conf
>                                       else
>                                           # Display a message
>                                           echo "*** We do not modify
> /etc/nsswitch.conf automatically in"
>                                           echo "*** BATCH mode. Please
> modify it yourself."
>                                       fi
>                                       ;;
>         POST-DEINSTALL)
>                                       # Do something to remove the
> entry that was added to /etc/nsswitch.conf
>                                       ;;
> esac
> 
> It might be better to add a pkg-message to the port that shows how to
> modify /etc/nsswitch.conf, instead of having the port modify it.
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20141121/5f06f851/attachment.sig>


More information about the freebsd-ports mailing list