update systemd services to use instance strings

This commit is contained in:
ixces 2025-06-30 05:26:56 +03:00 committed by icxes
parent 0015d61164
commit b53d02ff60
2 changed files with 11 additions and 9 deletions

View file

@ -1,8 +1,8 @@
# this will start `/usr/bin/copyparty-sfx.py` # this will start `/usr/bin/copyparty`
# and read config from `/etc/copyparty.d/*.conf` # and read config from `/etc/copyparty.d/*.conf`
# #
# you probably want to: # the %i refers to whatever you put after the copyparty@
# change "User=cpp" and "/home/cpp/" to another user # so with copyparty@foo.service, %i == foo
# #
# unless you add -q to disable logging, you may want to remove the # unless you add -q to disable logging, you may want to remove the
# following line to allow buffering (slightly better performance): # following line to allow buffering (slightly better performance):
@ -19,8 +19,8 @@ WorkingDirectory=/var/lib/copyparty-jail
ExecReload=/bin/kill -s USR1 $MAINPID ExecReload=/bin/kill -s USR1 $MAINPID
# user to run as + where the TLS certificate is (if any) # user to run as + where the TLS certificate is (if any)
User=cpp User=%i
Environment=XDG_CONFIG_HOME=/home/cpp/.config Environment=XDG_CONFIG_HOME=/home/%i/.config
# stop systemd-tmpfiles-clean.timer from deleting copyparty while it's running # stop systemd-tmpfiles-clean.timer from deleting copyparty while it's running
ExecStartPre=+/bin/bash -c 'mkdir -p /run/tmpfiles.d/ && echo "x /tmp/pe-copyparty*" > /run/tmpfiles.d/copyparty.conf' ExecStartPre=+/bin/bash -c 'mkdir -p /run/tmpfiles.d/ && echo "x /tmp/pe-copyparty*" > /run/tmpfiles.d/copyparty.conf'

View file

@ -1,11 +1,13 @@
# this will start `/usr/bin/copyparty-sfx.py` # this will start `/usr/bin/copyparty`
# in a chroot, preventing accidental access elsewhere, # in a chroot, preventing accidental access elsewhere,
# and read copyparty config from `/etc/copyparty.d/*.conf` # and read copyparty config from `/etc/copyparty.d/*.conf`
# #
# expose additional filesystem locations to copyparty # expose additional filesystem locations to copyparty
# by listing them between the last `cpp` and `--` # by listing them between the last `%i` and `--`
# #
# `cpp cpp` = user/group to run copyparty as; can be IDs (1000 1000) # `%i %i` = user/group to run copyparty as; can be IDs (1000 1000)
# the %i refers to whatever you put after the prisonparty@
# so with prisonparty@foo.service, %i == foo
# #
# unless you add -q to disable logging, you may want to remove the # unless you add -q to disable logging, you may want to remove the
# following line to allow buffering (slightly better performance): # following line to allow buffering (slightly better performance):
@ -24,7 +26,7 @@ ExecReload=/bin/kill -s USR1 $MAINPID
ExecStartPre=+/bin/bash -c 'mkdir -p /run/tmpfiles.d/ && echo "x /tmp/pe-copyparty*" > /run/tmpfiles.d/copyparty.conf' ExecStartPre=+/bin/bash -c 'mkdir -p /run/tmpfiles.d/ && echo "x /tmp/pe-copyparty*" > /run/tmpfiles.d/copyparty.conf'
# run copyparty # run copyparty
ExecStart=/bin/bash /usr/bin/prisonparty /var/lib/copyparty-jail cpp cpp \ ExecStart=/bin/bash /usr/bin/prisonparty /var/lib/copyparty-jail %i %i \
/etc/copyparty.d \ /etc/copyparty.d \
-- \ -- \
/usr/bin/python3 /usr/bin/copyparty -c /etc/copyparty.d/init /usr/bin/python3 /usr/bin/copyparty -c /etc/copyparty.d/init