mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
35 lines
1.4 KiB
Desktop File
35 lines
1.4 KiB
Desktop File
# this will start `/usr/local/bin/copyparty-sfx.py`
|
|
# and share '/mnt' with anonymous read+write
|
|
#
|
|
# installation:
|
|
# cp -pv copyparty.service /etc/systemd/system && systemctl enable --now copyparty
|
|
#
|
|
# you may want to:
|
|
# change '/usr/bin/python' to another interpreter
|
|
# change '/mnt::rw' to another location or permission-set
|
|
#
|
|
# with `Type=notify`, copyparty will signal systemd when it is ready to
|
|
# accept connections; correctly delaying units depending on copyparty.
|
|
# But note that journalctl will get the timestamps wrong due to
|
|
# python disabling line-buffering, so messages are out-of-order:
|
|
# https://user-images.githubusercontent.com/241032/126040249-cb535cc7-c599-4931-a796-a5d9af691bad.png
|
|
#
|
|
# enable line-buffering for realtime logging (slight performance cost):
|
|
# modify ExecStart and prefix it with `/usr/bin/stdbuf -oL` like so:
|
|
# ExecStart=/usr/bin/stdbuf -oL /usr/bin/python3 [...]
|
|
# but some systemd versions require this instead (higher performance cost):
|
|
# inside the [Service] block, add the following line:
|
|
# Environment=PYTHONUNBUFFERED=x
|
|
|
|
[Unit]
|
|
Description=copyparty file server
|
|
|
|
[Service]
|
|
Type=notify
|
|
SyslogIdentifier=copyparty
|
|
ExecStart=/usr/bin/python3 /usr/local/bin/copyparty-sfx.py -q -v /mnt::rw
|
|
ExecStartPre=/bin/bash -c 'mkdir -p /run/tmpfiles.d/ && echo "x /tmp/pe-copyparty*" > /run/tmpfiles.d/copyparty.conf'
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|