Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM installation is not creating needed Linux user/group "ntfy" #83

Closed
cmeis opened this issue Jan 4, 2022 · 7 comments
Closed

RPM installation is not creating needed Linux user/group "ntfy" #83

cmeis opened this issue Jan 4, 2022 · 7 comments
Labels
🪲 bug Something isn't working server Relates to the main binary (server or client)

Comments

@cmeis
Copy link
Contributor

cmeis commented Jan 4, 2022

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

@binwiederhier
Copy link
Owner

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.

@binwiederhier binwiederhier added 🪲 bug Something isn't working server Relates to the main binary (server or client) labels Jan 4, 2022
@cmeis
Copy link
Contributor Author

cmeis commented 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...

@binwiederhier
Copy link
Owner

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. :-)

@cmeis
Copy link
Contributor Author

cmeis commented 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...

@binwiederhier
Copy link
Owner

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.

@cmeis
Copy link
Contributor Author

cmeis commented 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).

@binwiederhier
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working server Relates to the main binary (server or client)
Projects
None yet
Development

No branches or pull requests

2 participants