1 denise.eckstein 1.3 # Start of section pegasus/rpm/tog-specfiles/tog-pegasus-pre.spec
2 # install remove upgrade reinstall
3 # pre 1 - 2 2
4 #
5 # If it exists, the active OpenPegasus Repository
6 # directory, %PEGASUS_REPOSITORY_DIR is renamed
7 # to %PEGASUS_PREV_REPOSITORY_DIR. If
8 # %PEGASUS_PREV_REPOSITORY_DIR already exists,
9 # it is saved as an archive file.
10
11 if [ -d %PEGASUS_REPOSITORY_DIR"/root#PG_Internal" ]; then
12 #
13 # Save the current repository to prev_repository
14 #
15 if [ -d %PEGASUS_PREV_REPOSITORY_DIR ]; then
16 /bin/tar -C %PEGASUS_REPOSITORY_PARENT_DIR -cf \
17 %PEGASUS_PREV_REPOSITORY_DIR`date '+%Y-%m-%d-%s.%N'`.tar \
18 %PEGASUS_PREV_REPOSITORY_DIR_NAME
19 rm -rf %PEGASUS_PREV_REPOSITORY_DIR
20 fi
21 /bin/mv %PEGASUS_REPOSITORY_DIR %PEGASUS_PREV_REPOSITORY_DIR
|
22 denise.eckstein 1.1 fi
|
23 w.otsuka 1.4 if [ $1 -gt 0 ]; then
|
24 denise.eckstein 1.3 # Create the 'pegasus' user and group:
25 /usr/sbin/groupadd pegasus > /dev/null 2>&1 || :;
26 /usr/sbin/useradd -c "tog-pegasus OpenPegasus WBEM/CIM services" \
27 -g pegasus -s /sbin/nologin -r -d %PEGASUS_VARDATA_DIR pegasus \
28 > /dev/null 2>&1 || :;
29 fi
|
30 yi.zhou 1.7 if [ $1 -eq 2 ]; then
31 rm -f %PEGASUS_LOCAL_DOMAIN_SOCKET_PATH;
32 rm -f %PEGASUS_CIMSERVER_START_FILE;
|
33 yi.zhou 1.8 rm -f %PEGASUS_CIMSERVER_START_LOCK_FILE;
|
34 yi.zhou 1.7 fi
|
35 denise.eckstein 1.3 #
36 # End of section pegasus/rpm/tog-specfiles/tog-pegasus-pre.spec
|