File: graphite-web.postinst

package info (click to toggle)
graphite-web 1.1.10-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,864 kB
  • sloc: javascript: 86,828; python: 12,228; sh: 91; makefile: 54
file content (26 lines) | stat: -rw-r--r-- 670 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

set -e

DIRS="/var/log/graphite /var/lib/graphite"
CONFFILE="/etc/graphite/local_settings.py"

if [ "$1" = "configure" ]; then
	if ! getent passwd _graphite > /dev/null; then
		adduser --system --quiet --home /var/lib/graphite --no-create-home \
			--shell /bin/false --force-badname --group --gecos "Graphite User" _graphite
	fi

	for i in $DIRS; do
		mkdir -m 0755 -p $i
		if ! dpkg-statoverride --list $i >/dev/null 2>&1; then
			dpkg-statoverride --update --add _graphite _graphite 0755 $i
		fi
	done

	if ! dpkg-statoverride --list $CONFFILE >/dev/null 2>&1; then
		dpkg-statoverride --update --add _graphite _graphite 0400 $CONFFILE
	fi
fi

#DEBHELPER#