~ubuntu-branches/debian/squeeze/firebird2.0/squeeze

« back to all changes in this revision

Viewing changes to builds/install/arch-specific/hpux/misc/hpuxLibrary.sh.in

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2009-05-04 11:17:29 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090504111729-vrob1xe54hrvf8ij
Tags: 2.0.5.13206-0.ds2-3
change Section to database

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
RunUser=firebird
 
4
export RunUser
 
5
RunGroup=firebird
 
6
export RunGroup
 
7
PidDir=/var/run/firebird
 
8
export PidDir
 
9
 
 
10
#------------------------------------------------------------------------
 
11
#  Add new user and group
 
12
 
 
13
TryAddGroup() {
 
14
 
 
15
        AdditionalParameter=$1
 
16
        testStr=`grep firebird /etc/group`
 
17
        
 
18
    if [ -z "$testStr" ]
 
19
      then
 
20
        groupadd $AdditionalParameter firebird
 
21
    fi
 
22
        
 
23
}
 
24
 
 
25
 
 
26
TryAddUser() {
 
27
 
 
28
        AdditionalParameter=$1
 
29
        testStr=`grep firebird /etc/passwd`
 
30
        
 
31
    if [ -z "$testStr" ]
 
32
      then
 
33
        useradd $AdditionalParameter -d $FBRootDir -s /bin/false \
 
34
            -c "Firebird Database Owner" -g firebird firebird 
 
35
    fi
 
36
 
 
37
}
 
38
 
 
39
 
 
40
addFirebirdUser() {
 
41
 
 
42
        TryAddGroup "-g 84 -r" >/dev/null 2>&1
 
43
        TryAddGroup "-g 84" >/dev/null 2>&1
 
44
        TryAddGroup "-r" >/dev/null 2>&1
 
45
        TryAddGroup " "
 
46
        
 
47
        TryAddUser "-u 84 -r" >/dev/null 2>&1
 
48
        TryAddUser "-u 84" >/dev/null 2>&1
 
49
        TryAddUser "-r" >/dev/null 2>&1
 
50
        TryAddUser " "
 
51
 
 
52
}
 
53
 
 
54
 
 
55
#------------------------------------------------------------------------
 
56
#  print location of init script
 
57
 
 
58
getInitScriptLocation() {
 
59
    if [ -f /etc/rc.d/init.d/firebird ]
 
60
        then
 
61
                echo -n /etc/rc.d/init.d/firebird
 
62
    elif [ -f /etc/rc.d/rc.firebird ]
 
63
        then
 
64
                echo -n /etc/rc.d/rc.firebird
 
65
    elif [ -f /etc/init.d/firebird ]
 
66
        then
 
67
                echo -n /etc/init.d/firebird
 
68
    fi
 
69
}
 
70
 
 
71
 
 
72
#------------------------------------------------------------------------
 
73
#  stop super server if it is running
 
74
 
 
75
stopSuperServerIfRunning() {
 
76
    checkString=`ps -eaf | egrep "\b(fbserver|fbguard)\b" |grep -v grep`
 
77
 
 
78
    if [ ! -z "$checkString" ]
 
79
    then
 
80
                init_d=`getInitScriptLocation`
 
81
 
 
82
        if [ -x "$init_d" ]
 
83
                then
 
84
            $init_d stop
 
85
                fi
 
86
    fi
 
87
}
 
88
#-----------------------------------------------------------------------
 
89
# Blank stub on HPUX - don't use openssl
 
90
 
 
91
generateNewDBAPassword() {
 
92
echo "generateNewDBAPassword" >/dev/null 2>&1
 
93
}