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

Do not depend on systemctl/systemd exclusively for debian/postinst and debian/prerm #28

Open
wyatt8740 opened this issue Aug 12, 2020 · 3 comments

Comments

@wyatt8740
Copy link

wyatt8740 commented Aug 12, 2020

My Debian system is using sysvinit and elogind. This makes the debian packages fail to install due to their reliance on systemctl to start and stop the software.

Selecting previously unselected package rtpmidid.
(Reading database ... 755593 files and directories currently installed.)
Preparing to unpack rtpmidid_20.07_amd64.deb ...
Unpacking rtpmidid (20.07) ...
Setting up rtpmidid (20.07) ...
Adding user rtpmidid to group audio
/var/lib/dpkg/info/rtpmidid.postinst: 28: systemctl: not found
/var/lib/dpkg/info/rtpmidid.postinst: 29: systemctl: not found
dpkg: error processing package rtpmidid (--install):
 installed rtpmidid package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 rtpmidid

I'd suggest checking that it exists and alerting the user that the program cannot be started automatically without systemd, or else maybe some LSB init scripts.

It looks like maybe you were attempting to do this, but at some point your postinst script got messed up. Line 27 of one of them currently reads: if [ -e /usr.

Alternatively you could make systemd | systemctl a hard dependency, but I'd personally rather you didn't since it's unnecessary. I just got it working on my system by rebuilding the debian package with some tweaks to postinst/prerm and a little setgid/setuid trickery (hopefully safe enough) to make rtpmidid run as the rtpmidid user and create a socket file with correct permissions (rtpmidid:audio ownership, I think).

Something like:

type systemctl
if [ $? -ne 0 ]; then
    # handle systemctl not found
else
    # systemctl commands
fi

Setting up /var/run/rtpmidid and the like would probably be left up to the user on such systems (unless a few more changes are made, anyway), so maybe that would be something to warn people about in the handling section.

@davidmoreno
Copy link
Owner

I will try to do something for next release, but its low priority.

On the other hand, a merge request is almost guaranteed to be accepted if it solves this problem.

@wyatt8740
Copy link
Author

OK, I'll try to remember to submit my changes.

@mhelin
Copy link

mhelin commented Dec 9, 2020

This is also problem on WSL2 (Windows Subsystem for Linux) in Windows 10, though it also lacks the /dev/snd/seq kernel driver - quess rtpmidid can't be easily implemented without ALSA sequencer support (instead of sequencer device some other interface or API would be needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants