Simon Kelley | bc54ae3 | 2012-08-28 21:26:56 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | set -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) |
| 7 | if [ "$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 Kelley | 4790115 | 2015-09-29 22:54:41 +0100 | [diff] [blame] | 20 | if [ ! -d /run/dnsmasq ]; then |
| 21 | mkdir /run/dnsmasq |
| 22 | chown dnsmasq:nogroup /run/dnsmasq |
Simon Kelley | bc54ae3 | 2012-08-28 21:26:56 +0100 | [diff] [blame] | 23 | fi |
| 24 | fi |