Skip to content

dnf install fails and rpm partially fails because postinst.sh has syntax errors #566

Closed
@danieldemus

Description

@danieldemus

On the first install attempt user and group creation fail, because the syntax of chown is incorrect:
chown ntfy.ntfy /var/cache/ntfy /var/cache/ntfy/attachments /var/lib/ntfy
It should ntfy:ntfy.
On uninstall the group is not necessarily removed, if fx. the apache user is added to it to allow reading the socket. This means that on the next install attempt
id ntfy >/dev/null 2>&1 || useradd --system --no-create-home ntfy fails, when useradd tries to add the group again.
The fedora packaging guidelines at https://fedoraproject.org/wiki/Packaging:UsersAndGroups suggest:

getent group GROUPNAME >/dev/null || groupadd -r GROUPNAME
getent passwd USERNAME >/dev/null || \
    useradd -r -g GROUPNAME -d HOMEDIR -s /sbin/nologin \
    -c "Useful comment about the purpose of this account" USERNAME
exit 0

In this case #565 could also do the job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions