-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement OpenRC support by providing RC service script
This commit adds a service script for an OpenRC init system. It intends to mitigate "race" caused by a start of long-living process (that is `usbmuxd` itself) by udev rules, which is highly discouraged by the `udev` manpage: "Starting daemons or other long-running processes is not allowed; the forked processes, detached or not, will be unconditionally killed after the event handling has finished." There is a bug in `usbmuxd`, which causes the hang, but this is to be handled in a different commit. This adds two new `configure` flags: * `--with-openrc`: toggles on or off (default - off) OpenRC service installation and udev activation via that. Conflicts with systemd, so the latter must be disabled explicitly: `--with-openrc --without-systemd` * `--with-rcservicedir=DIR`: specifies directory where to install service file. Defaults to `$sysconfdir/init.d` (which is `/etc/init.d`) Issue: #210 Signed-off-by: BalkanMadman <[email protected]>
- Loading branch information
1 parent
360619c
commit 98601f5
Showing
6 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
if WANT_OPENRC | ||
edit = \ | ||
$(SED) -r \ | ||
-e 's|@sbindir[@]|$(sbindir)|g' \ | ||
< $< > $@ || rm $@ | ||
|
||
rcservice_SCRIPTS = usbmuxd | ||
|
||
usbmuxd: usbmuxd.in | ||
$(edit) | ||
|
||
EXTRA_DIST = \ | ||
usbmuxd.in | ||
|
||
MAINTAINERCLEANFILES = \ | ||
usbmuxd | ||
|
||
CLEANFILES = \ | ||
usbmuxd | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/sbin/openrc-run | ||
# Copyright 2023 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
name="USB multiplexing daemon" | ||
description="Socket daemon for the usbmux protocol used by Apple devices" | ||
command="@sbindir@/usbmuxd" | ||
command_args="--user usbmux" | ||
pidfile="/run/${RC_SVCNAME}.pid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters