blob: 50b148eb9882f123b1dd94b5148fee734b8850cb [file] [log] [blame]
Simon Kelleybc54ae32012-08-28 21:26:56 +01001#!/bin/sh
2set -e
3
4# Create the dnsmasq user in dnsmasq-base, so that Dbus doesn't complain.
5
6# create a user to run as (code stolen from dovecot-common)
7if [ "$1" = "configure" ]; then
8 if [ -z "`id -u dnsmasq 2> /dev/null`" ]; then
9 adduser --system --home /var/lib/misc --gecos "dnsmasq" \
10 --no-create-home --disabled-password \
11 --quiet dnsmasq || true
12 fi
13
14 # Make the directory where we keep the pid file - this
15 # has to be owned by "dnsmasq" so that the file can be unlinked.
16 # This is only actually used by the dnsmasq binary package, not
17 # dnsmasq-base, but it's much easier to create it here so that
18 # we don't have synchronisation issues with the creation of the
19 # dnsmasq user.
Simon Kelley47901152015-09-29 22:54:41 +010020 if [ ! -d /run/dnsmasq ]; then
21 mkdir /run/dnsmasq
22 chown dnsmasq:nogroup /run/dnsmasq
Simon Kelleybc54ae32012-08-28 21:26:56 +010023 fi
24fi