[GH-ISSUE #83] RPM installation is not creating needed Linux user/group "ntfy" #67

Closed
opened 2026-05-07 00:19:29 +02:00 by BreizhHardware · 7 comments

Originally created by @cmeis on GitHub (Jan 4, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/83

The installation via RPM doesn't create the user/group "ntfy" referenced in the systemd service config file. Tested using current version 1.11.2.
This leads to the service not starting:

Jan 04 12:59:41 localhost.localdomain systemd[1]: Started ntfy server.
-- Subject: Unit ntfy.service has finished start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit ntfy.service has finished starting up.
--
-- The start-up result is done.
Jan 04 12:59:41 localhost.localdomain systemd[6584]: ntfy.service: Failed to determine user credentials: No such process
Jan 04 12:59:41 localhost.localdomain systemd[6584]: ntfy.service: Failed at step USER spawning /usr/bin/ntfy: No such process
-- Subject: Process /usr/bin/ntfy could not be executed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The process /usr/bin/ntfy could not be executed and failed.
--
-- The error number returned by this process is 3.
Jan 04 12:59:41 localhost.localdomain systemd[1]: ntfy.service: Main process exited, code=exited, status=217/USER
Jan 04 12:59:41 localhost.localdomain systemd[1]: ntfy.service: Failed with result 'exit-code'.

Manually creating this user/group solves the problem for now

Originally created by @cmeis on GitHub (Jan 4, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/83 The installation via RPM doesn't create the user/group "ntfy" referenced in the systemd service config file. Tested using current version 1.11.2. This leads to the service not starting: ``` Jan 04 12:59:41 localhost.localdomain systemd[1]: Started ntfy server. -- Subject: Unit ntfy.service has finished start-up -- Defined-By: systemd -- Support: https://access.redhat.com/support -- -- Unit ntfy.service has finished starting up. -- -- The start-up result is done. Jan 04 12:59:41 localhost.localdomain systemd[6584]: ntfy.service: Failed to determine user credentials: No such process Jan 04 12:59:41 localhost.localdomain systemd[6584]: ntfy.service: Failed at step USER spawning /usr/bin/ntfy: No such process -- Subject: Process /usr/bin/ntfy could not be executed -- Defined-By: systemd -- Support: https://access.redhat.com/support -- -- The process /usr/bin/ntfy could not be executed and failed. -- -- The error number returned by this process is 3. Jan 04 12:59:41 localhost.localdomain systemd[1]: ntfy.service: Main process exited, code=exited, status=217/USER Jan 04 12:59:41 localhost.localdomain systemd[1]: ntfy.service: Failed with result 'exit-code'. ``` Manually creating this user/group solves the problem for now
BreizhHardware 2026-05-07 00:19:29 +02:00
Author
Owner

@binwiederhier commented on GitHub (Jan 4, 2022):

It was a late addition to add the user. If you can provide a PR to fix it that would help. If not I'll get to it eventually. My apologies.

<!-- gh-comment-id:1004778796 --> @binwiederhier commented on GitHub (Jan 4, 2022): It was a late addition to add the user. If you can provide a PR to fix it that would help. If not I'll get to it eventually. My apologies.
Author
Owner

@cmeis commented on GitHub (Jan 4, 2022):

Hm, just had a look at the postinst.sh / postrm.sh and they both seem to contain the necessary code the create/delete the user.
The problem will be that I'm testing on a RedHat flavour system, where the parameters to the postinst.sh/postrm.sh seem to be different.
Where $1 is "configure" or "purge" on Debian (which is in your code), RedHat-flavoured systems will use a "1" for upgrade (and install?) and a "0" for removal.
I'll try to whip up some dev VM to be able to build the rpm and test myself...

<!-- gh-comment-id:1004829676 --> @cmeis commented on GitHub (Jan 4, 2022): Hm, just had a look at the postinst.sh / postrm.sh and they both seem to contain the necessary code the create/delete the user. The problem will be that I'm testing on a RedHat flavour system, where the parameters to the postinst.sh/postrm.sh seem to be different. Where $1 is "configure" or "purge" on Debian (which is in your code), RedHat-flavoured systems will use a "1" for upgrade (and install?) and a "0" for removal. I'll try to whip up some dev VM to be able to build the rpm and test myself...
Author
Owner

@binwiederhier commented on GitHub (Jan 4, 2022):

That's what I figured. It would be super awesome if you could fix those. If not, I'll probably figure something out, but it won't be today. :-)

<!-- gh-comment-id:1004831595 --> @binwiederhier commented on GitHub (Jan 4, 2022): That's what I figured. It would be super awesome if you could fix those. If not, I'll probably figure something out, but it won't be today. :-)
Author
Owner

@cmeis commented on GitHub (Jan 5, 2022):

I spent some hours yesterday trying to build ntfy locally.
No joy in RHEL world (missing cross compilers).
Installed an Ubuntu 20.04 workstation with development tools, but only ALMOST managed to get a build running through correctly.

Not sure where I'm going wrong, but will probably only find time to continue this next week...

<!-- gh-comment-id:1005499271 --> @cmeis commented on GitHub (Jan 5, 2022): I spent some hours yesterday trying to build ntfy locally. No joy in RHEL world (missing cross compilers). Installed an Ubuntu 20.04 workstation with development tools, but only ALMOST managed to get a build running through correctly. Not sure where I'm going wrong, but will probably only find time to continue this next week...
Author
Owner

@binwiederhier commented on GitHub (Jan 5, 2022):

I am very sorry you had such a hard time. The static linking and cross compiling and the docs issue make it annoying and hard.

I need to make that easier, and also make it build in a GitHub action.

<!-- gh-comment-id:1005500778 --> @binwiederhier commented on GitHub (Jan 5, 2022): I am very sorry you had such a hard time. The static linking and cross compiling and the docs issue make it annoying and hard. I need to make that easier, and also make it build in a GitHub action.
Author
Owner

@cmeis commented on GitHub (Jan 5, 2022):

Just created a pull request. No regular GitHub user here, so please bear with me ;-)
As I wasn't able to build the RPM locally, I used the rpmrebuild tool to modify the scriptlets in the official 1.11.2 rpm for local testing. In my testing users are created/removed correctly now on RHEL-flavoured Linux (tested on CentOS 8 and AlmaLinux 8).

<!-- gh-comment-id:1005652620 --> @cmeis commented on GitHub (Jan 5, 2022): Just created a pull request. No regular GitHub user here, so please bear with me ;-) As I wasn't able to build the RPM locally, I used the rpmrebuild tool to modify the scriptlets in the official 1.11.2 rpm for local testing. In my testing users are created/removed correctly now on RHEL-flavoured Linux (tested on CentOS 8 and AlmaLinux 8).
Author
Owner

@binwiederhier commented on GitHub (Jan 5, 2022):

Awesome, and the pull request looks great. I let some comments for you.

<!-- gh-comment-id:1005693059 --> @binwiederhier commented on GitHub (Jan 5, 2022): Awesome, and the pull request looks great. I let some comments for you.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#67
No description provided.