Revision a8132a6e
Added by Andreas Kohlbecker almost 13 years ago
src/main/installer/linux/postinst | ||
---|---|---|
1 |
#!/bin/sh |
|
1 |
#!/bin/sh -e
|
|
2 | 2 |
# postinst script for cdmserver |
3 | 3 |
# |
4 | 4 |
# see: dh_installdeb(1) |
5 | 5 |
|
6 |
set -e |
|
7 |
|
|
8 | 6 |
# |
9 | 7 |
# variables |
10 | 8 |
# |
11 |
CDM_HOME="/opt/cdmserver/"
|
|
9 |
CDM_HOME="/opt/cdmserver" |
|
12 | 10 |
CDM_CONFIG_TEMPLATE="/opt/cdmserver/templates/.cdmLibrary" |
13 |
CDM_LOG="/var/log/cdmserver/"
|
|
11 |
CDM_LOG="/var/log/cdmserver" |
|
14 | 12 |
|
15 | 13 |
INIT_SCRIPT="cdmserver" |
16 |
ETC_CDMSERVER="/etc/cdmserver/"
|
|
14 |
ETC_CDMSERVER="/etc/cdmserver" |
|
17 | 15 |
|
18 | 16 |
CDM_USER=cdm |
19 | 17 |
CDM_GROUP=cdm |
... | ... | |
77 | 75 |
# adjusting permissions of init script user and group should be root |
78 | 76 |
# |
79 | 77 |
chmod 755 /etc/init.d/$INIT_SCRIPT |
80 |
chown root:root /etc/init.d/$INIT_SCRIPT |
|
81 | 78 |
|
82 | 79 |
# |
83 | 80 |
# create log file folder and set owner:group |
... | ... | |
92 | 89 |
# /etc/cdmserver |
93 | 90 |
# AND create symlink |
94 | 91 |
# |
95 |
if [ ! -d $ETC_CDMSERVER.cdmLibrary ]
|
|
92 |
if [ ! -d $ETC_CDMSERVER ] |
|
96 | 93 |
then |
97 | 94 |
mkdir -p $ETC_CDMSERVER |
98 |
cp -r $CDM_CONFIG_TEMPLATE $ETC_CDMSERVER
|
|
95 |
cp -r $CDM_CONFIG_TEMPLATE/ $ETC_CDMSERVER/
|
|
99 | 96 |
fi |
100 | 97 |
# |
101 | 98 |
# also create a .cdmLibrary folder in user home, it will hold temporary files |
102 | 99 |
# and symlinks to the configfiles |
103 | 100 |
# |
104 |
mkdir $CDM_USER_HOME.cdmLibrary |
|
105 |
cd $CDM_USER_HOME.cdmLibrary |
|
106 |
ln -s $ETC_CDMSERVER.cdmLibrary/datasources.xml datasources.xml |
|
107 |
ln -s $ETC_CDMSERVER.cdmLibrary/cdm-server-realm.properties cdm-server-realm.properties |
|
101 |
if [ ! -e $CDM_USER_HOME/.cdmLibrary ] |
|
102 |
then |
|
103 |
mkdir $CDM_USER_HOME/.cdmLibrary |
|
104 |
fi |
|
105 |
cd $CDM_USER_HOME/.cdmLibrary |
|
106 |
ln -s $ETC_CDMSERVER/datasources.xml datasources.xml |
|
107 |
ln -s $ETC_CDMSERVER/cdm-server-realm.properties cdm-server-realm.properties |
|
108 | 108 |
|
109 | 109 |
# |
110 | 110 |
# set group and owner for home directory |
... | ... | |
114 | 114 |
# let the cdm server start automatically on boot |
115 | 115 |
update-rc.d $INIT_SCRIPT defaults 98 02 |
116 | 116 |
|
117 |
# start the server manually this time and ignore errors
|
|
117 |
# start the server manually this time ignoring errors
|
|
118 | 118 |
/etc/init.d/$INIT_SCRIPT start || true |
119 | 119 |
|
120 | 120 |
;; |
Also available in: Unified diff
debian package done!server startup