Skip to content

Commit

Permalink
Create basic OpenRC service
Browse files Browse the repository at this point in the history
Support is optional, therefore init/conf files will be prepared
for packagers while building but not installed.

Closes medusalix#102
  • Loading branch information
kapsh committed Aug 11, 2020
1 parent a3d2b01 commit fc63566
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ firmware.bin:
.PHONY: install
install: xow
sed 's|#BINDIR#|$(BINDIR)|' install/service.in > xow.service
sed 's|#BINDIR#|$(BINDIR)|' install/openrc/init.in > install/openrc/init
install -D -m 755 xow $(DESTDIR)$(BINDIR)/xow
install -D -m 644 install/udev.rules $(DESTDIR)$(UDEVDIR)/50-xow.rules
install -D -m 644 install/modules.conf $(DESTDIR)$(MODLDIR)/xow-uinput.conf
Expand Down
6 changes: 6 additions & 0 deletions install/openrc/conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Uncomment the following line to enable compatibility mode
#XOW_COMPATIBILITY=1

# Defaults to nobody if not set
XOW_USER=
XOW_GROUP=
22 changes: 22 additions & 0 deletions install/openrc/init.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/sbin/openrc-run

description="Xbox One Wireless Dongle Driver"
command="#BINDIR#/xow"

command_user="${XOW_USER:-nobody}:${XOW_GROUP:-nobody}"
command_background="true"
pidfile="/run/${RC_SVCNAME}.pid"

output_log="/var/log/${RC_SVCNAME}.log"
error_log="${output_log}"

depend() {
keyword -lxc -openvz -docker
}

start_pre() {
checkpath -q \
-o "${command_user}" \
-f "${output_log}"
}

0 comments on commit fc63566

Please sign in to comment.