* update the changelog
[tango.git] / debian / tango-common.preinst
blobf900a20ec0156cbb72efd5e195c63e84ebc07ea4
1 #!/bin/sh
3 DATADIR=/var/lib/tango
5 #DEBHELPER#
7 # If we use NIS then errors should be tolerated. It's up to the
8 # user to ensure that the mysql user is correctly setup.
9 # Beware that there are two ypwhich one of them needs the 2>/dev/null!
10 if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
11 set +e
15 # Now we have to ensure the following state:
16 # /etc/passwd: tango:x:100:101:Tango Server:/var/lib/tango:/bin/false
17 # /etc/group: tango:x:101:
19 # Sadly there could any state be present on the system so we have to
20 # modify everything carefully i.e. not doing a chown before creating
21 # the user etc...
24 # creating tango group if he isn't already there
25 if ! getent group tango >/dev/null; then
26 # Adding system group: tango.
27 addgroup --system tango >/dev/null
30 # creating tango user if he isn't already there
31 if ! getent passwd tango >/dev/null; then
32 # Adding system user: tango.
33 adduser \
34 --system \
35 --ingroup tango \
36 --home $DATADIR \
37 --gecos "Tango Server" \
38 --shell /bin/false \
39 tango >/dev/null
42 # end of NIS tolerance zone
43 set -e