pkg installation && adduser

Patrick Hess patrickhess at gmx.net
Tue Aug 4 18:42:36 UTC 2015


Matthias Apitz wrote:
> I'm trying to understand how the package command creates users during
> the installation of packages, for example the dbus-1.8.8.txz does not
> contain any file or script for creating the groups and user
> 'messagebus'. How this is done during 'pkg install dbus'.
> 
> [...]
>
> # tar tzf work/pkg/dbus-1.8.8.txz | fgrep +
> +COMPACT_MANIFEST
> +MANIFEST

Take a look at the contents of that +MANIFEST file (linebreaks added
here for better readability):

    # tar xvf dbus-1.8.20.txz
    x +COMPACT_MANIFEST
    x +MANIFEST
    [...]

    # cat +MANIFEST
    [...]
    "scripts":
      {"pre-install":
         "echo \"===> Creating users and/or groups.\"
         if ! /usr/sbin/pw groupshow messagebus >/dev/null 2>&1; then
            echo \"Creating group 'messagebus' with gid '556'.\" 
            /usr/sbin/pw groupadd messagebus -g 556
    [...]

Patrick


More information about the freebsd-questions mailing list