summaryrefslogtreecommitdiff
path: root/pypaste-initd
diff options
context:
space:
mode:
Diffstat (limited to 'pypaste-initd')
-rw-r--r--pypaste-initd26
1 files changed, 18 insertions, 8 deletions
diff --git a/pypaste-initd b/pypaste-initd
index 52c449d..4f5e399 100644
--- a/pypaste-initd
+++ b/pypaste-initd
@@ -5,25 +5,35 @@ depend() {
}
supervisor=supervise-daemon
-command="/usr/bin/pypaste"
+
+command="python"
+
command_args="
+ -m
+ pypaste.server
--site=${PYPASTE_SITE}
--content-length-max-bytes=${PYPASTE_CONTENT_LENGTH_MAX_BYTES}
- --endpoint=${PYPASTE_ENDPOINT}
- --region=${PYPASTE_REGION}
- --bucket=${PYPASTE_BUCKET}
- --access-key=${PYPASTE_ACCESS_KEY}
- --secret-key=${PYPASTE_SECRET_KEY}
- --s3-max-bytes=${PYPASTE_S3_MAX_BYTES}
+ --storage-max-bytes=${PYPASTE_STORAGE_MAX_BYTES}
--default-style=${PYPASTE_DEFAULT_STYLE}
--key-length=${PYPASTE_KEY_LENGTH}
--dictionary=${PYPASTE_DICTIONARY}
--database=${PYPASTE_DATABASE}
--default-style=${PYPASTE_STYLE}
+ --socket=${PYPASTE_SOCKET_DIR}/${PYPASTE_SOCKET_NAME}
+ --socket-mode=0666
+ --default-style=${PYPASTE_DEFAULT_STYLE}
${PYPASTE_ARGS}
"
-error_log="${PYPASTE_ERROR_LOG}"
+error_log="${PYPASTE_LOG_FILE}"
: "${command_user=pypaste:pypaste}"
+start_pre() {
+ touch ${PYPASTE_LOG_FILE} || return $?
+ chown pypaste:pypaste ${PYPASTE_LOG_FILE} || return $?
+ mkdir -p ${PYPASTE_SOCKET_DIR} || return $?
+ setfacl -m 'u:pypaste:rwx' ${PYPASTE_SOCKET_DIR} || return $?
+ setfacl -m 'u:lighttpd:rwx' ${PYPASTE_SOCKET_DIR} || return $?
+ rm -f ${PYPASTE_SOCKET_DIR}/${PYPASTE_SOCKET_NAME}
+}