Hello,
I am trying to write a port that creates a user
I added the following in the Makefile:
However, when I run
I'm assuming it's because
How should one approach this problem? Thank you for your help
I am trying to write a port that creates a user
_xd
and a group _xd
(added as 839 in UIDs and GIDs) and gives them ownership of the configuration directory ${PREFIX}/etc/xd-torrent
added by the port. The software creates sample config files if they don't exist and updates one of the files from time to time, so it needs to have write access to the directory and its content.I added the following in the Makefile:
Code:
USERS= _xd
GROUPS= _xd
# [...]
post-install:
# [...]
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/xd-torrent
@${CHOWN} ${USERS}:${GROUPS} ${STAGEDIR}${PREFIX}/etc/xd-torrent
However, when I run
make package
, it fails with the following:
Code:
chown: _xd: illegal group name
*** Error code 1
Stop.
make: stopped in /usr/ports/net-p2p/xd-torrent
I'm assuming it's because
make
is trying to chmod
the directory in the staging location before the user and group are created (this happens when the package is installed). I tried placing these commands in the pkg-post-install
target instead, but it didn't seem to be doing anything.How should one approach this problem? Thank you for your help