3 if [ "$(id -u)" != 0 ] ; then
4 echo "You must be root to start Sedna DB as daemon."
13 dsc
="Sedna XML Database Server"
15 log
="/var/log/sedna.log"
17 if [ -z $user ] ; then
18 echo "Unable to run $dsc. You must set a user in /etc/conf.d/sednad"
22 # [ -f $log ] && rm -f $log
26 stat_busy
"Starting $dsc"
29 printf "${C_FAIL}$dsc already running.${C_OTHER} \n"
32 #chown -R $user /opt/sedna/data /opt/sedna/cfg - перенес в install скрипт
33 su
$user -s /bin
/sh
-c "/opt/sedna/bin/se_gov &> $log "
34 if [ ! -z "$(grep 'ERROR' $log)" ] ; then
36 printf "${C_FAIL}`cat $log`${C_OTHER} \n"
42 if [ ! -z $databases ] ; then
43 for db
in ${databases[@]}; do
44 stat_busy
"Starting $dsc1 '$db'"
45 su
$user -s /bin
/sh
-c "/opt/sedna/bin/se_sm $db &> $log "
46 if [ ! -z "$(grep 'ERROR' $log)" ] ; then
48 printf "${C_FAIL}`cat $log`${C_OTHER} \n"
61 if [ ! -z $databases ] ; then
62 for db
in ${databases[@]}; do
63 stat_busy
"Stopping $dsc1 '$db'"
64 su
$user -s /bin
/sh
-c "/opt/sedna/bin/se_smsd $db &> $log "
65 if [ ! -z "$(grep 'ERROR' $log)" ] ; then
67 printf "${C_FAIL}`cat $log`${C_OTHER} \n"
73 stat_busy
"Stopping $dsc"
74 su
$user -s /bin
/sh
-c "/opt/sedna/bin/se_stop &> $log "
75 if [ ! -z "$(grep 'ERROR' $log)" ]; then
77 printf "${C_FAIL}`cat $log`${C_OTHER} \n"
91 echo "usage: $0 {start|stop|restart}"