File: moosefs-common.postinst

package info (click to toggle)
moosefs 3.0.117-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,220 kB
  • sloc: ansic: 93,900; sh: 5,021; makefile: 632; javascript: 543
file content (22 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

set -e

case "${1}" in
    configure)
        if ! getent passwd mfs > /dev/null 2>&1; then
            adduser_args="--quiet --system --group --disabled-login --no-create-home --home /var/lib/mfs mfs"

            ## UID consistency of the "mfs" user is helpful to interchange
            ## HDDs between chunkservers.
            ## UID for the 400...800 range is produced by the following command:
            ##    perl -E 'srand(unpack q{%C*}, $ARGV[0]); say 400+int(rand(399));' mfs
            ## Try to create user "mfs" with UID=420:
            adduser ${adduser_args} --uid 420 ||\
            adduser ${adduser_args}
        fi
        chown mfs:mfs /var/lib/mfs
    ;;
esac

#DEBHELPER#