2022-07-09 17:10:30 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2024-02-01 21:42:23 +01:00
|
|
|
SUPERVISORD_WORKING_DIR="${PAPERLESS_SUPERVISORD_WORKING_DIR:-$PWD}"
|
2022-07-09 17:10:30 -04:00
|
|
|
rootless_args=()
|
2022-08-03 13:26:04 -07:00
|
|
|
if [ "$(id -u)" == "$(id -u paperless)" ]; then
|
2022-07-09 17:10:30 -04:00
|
|
|
rootless_args=(
|
|
|
|
|
--user
|
|
|
|
|
paperless
|
|
|
|
|
--logfile
|
2024-02-01 21:42:23 +01:00
|
|
|
"${SUPERVISORD_WORKING_DIR}/supervisord.log"
|
2022-07-09 17:10:30 -04:00
|
|
|
--pidfile
|
2024-02-01 21:42:23 +01:00
|
|
|
"${SUPERVISORD_WORKING_DIR}/supervisord.pid"
|
2022-07-09 17:10:30 -04:00
|
|
|
)
|
|
|
|
|
fi
|
|
|
|
|
|
2022-09-20 12:13:40 +02:00
|
|
|
exec /usr/local/bin/supervisord -c /etc/supervisord.conf "${rootless_args[@]}"
|