1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-23 07:23:40 +00:00
scrapy/debian/scrapyd.postinst

34 lines
704 B
Bash

#!/bin/sh
set -e
case "$1" in
configure)
# Create user to run the service as
if [ -z "`id -u scrapy 2> /dev/null`" ]; then
adduser --system --home /var/lib/scrapyd --gecos "scrapy" \
--no-create-home --disabled-password \
--quiet scrapy || true
fi
chown scrapy:nogroup /var/log/scrapyd \
/var/lib/scrapyd /var/lib/scrapyd/eggs /var/lib/scrapyd/dbs
update-python-modules -p # so upstart restart uses the new code
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0