wok rev 4957
init script for mysql, openldap & postgresql always check /etc/<daemon>.d/*
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Feb 17 22:01:10 2010 +0100 (2010-02-17) |
parents | 931c23265c9d |
children | affbc66f4142 |
files | mysql/stuff/etc/init.d/mysql openldap/stuff/etc/init.d/openldap postgresql/stuff/etc/init.d/postgresql |
line diff
1.1 --- a/mysql/stuff/etc/init.d/mysql Wed Feb 17 21:01:47 2010 +0100 1.2 +++ b/mysql/stuff/etc/init.d/mysql Wed Feb 17 22:01:10 2010 +0100 1.3 @@ -25,22 +25,17 @@ 1.4 echo "Initializing $DESC: " 1.5 rm -rf /var/lib/mysql/* 2> /dev/null 1.6 mysql_install_db --user=mysql --datadir=/var/lib/mysql 1.7 - echo -n "Starting $DESC: $NAME... " 1.8 - $DAEMON $OPTIONS & 1.9 - status 1.10 - sleep 2 1.11 - for i in /etc/mysql.d/* ; do 1.12 - [ -x $i ] || continue 1.13 - echo -n "Running $i..." 1.14 - $i 1.15 - status 1.16 - done 1.17 - else 1.18 - echo -n "Starting $DESC: $NAME... " 1.19 - $DAEMON $OPTIONS & 1.20 - status 1.21 - sleep 2 1.22 fi 1.23 + echo -n "Starting $DESC: $NAME... " 1.24 + $DAEMON $OPTIONS & 1.25 + status 1.26 + sleep 2 1.27 + for i in /etc/mysql.d/* ; do 1.28 + [ -x $i ] || continue 1.29 + echo -n "Running $i..." 1.30 + $i 1.31 + status 1.32 + done 1.33 ;; 1.34 stop) 1.35 if ! active_pidfile $PIDFILE mysqld ; then
2.1 --- a/openldap/stuff/etc/init.d/openldap Wed Feb 17 21:01:47 2010 +0100 2.2 +++ b/openldap/stuff/etc/init.d/openldap Wed Feb 17 22:01:10 2010 +0100 2.3 @@ -20,21 +20,15 @@ 2.4 echo "$NAME already running." 2.5 exit 1 2.6 fi 2.7 - if [ ! -f /var/openldap-data/__db.001 ]; then 2.8 - echo -n "Starting $DESC: $NAME... " 2.9 - $DAEMON $OPTIONS && sleep 2 2.10 - status 2.11 - for i in /etc/ldap.d/* ; do 2.12 + echo -n "Starting $DESC: $NAME... " 2.13 + $DAEMON $OPTIONS && sleep 2 2.14 + status 2.15 + for i in /etc/ldap.d/* ; do 2.16 [ -x $i ] || continue 2.17 echo -n "Running $i..." 2.18 $i 2.19 status 2.20 - done 2.21 - else 2.22 - echo -n "Starting $DESC: $NAME... " 2.23 - $DAEMON $OPTIONS && sleep 2 2.24 - status 2.25 - fi 2.26 + done 2.27 ;; 2.28 stop) 2.29 if ! active_pidfile $PIDFILE slapd ; then
3.1 --- a/postgresql/stuff/etc/init.d/postgresql Wed Feb 17 21:01:47 2010 +0100 3.2 +++ b/postgresql/stuff/etc/init.d/postgresql Wed Feb 17 22:01:10 2010 +0100 3.3 @@ -21,22 +21,17 @@ 3.4 echo "Initializing $DESC database" 3.5 rm -rf /var/lib/pgsql/* 2> /dev/null 3.6 su -c "initdb $INIT_OPTIONS" - postgres 3.7 - echo -n "Starting $DESC: $NAME... " 3.8 - su -c "pg_ctl start -w $OPTIONS -l /var/log/postgresql/postgresql.log" - postgres 3.9 - status 3.10 - sleep 2 3.11 - for i in /etc/pgsql.d/* ; do 3.12 + fi 3.13 + echo -n "Starting $DESC: $NAME... " 3.14 + su -c "pg_ctl start -w $OPTIONS -l /var/log/postgresql/postgresql.log" - postgres 3.15 + status 3.16 + sleep 2 3.17 + for i in /etc/pgsql.d/* ; do 3.18 [ -x $i ] || continue 3.19 echo -n "Running $i..." 3.20 $i 3.21 status 3.22 - done 3.23 - else 3.24 - echo -n "Starting $DESC: $NAME... " 3.25 - su -c "pg_ctl start -w $OPTIONS -l /var/log/postgresql/postgresql.log" - postgres 3.26 - status 3.27 - sleep 2 3.28 - fi 3.29 + done 3.30 # su -c "createdb test" - postgres 3.31 # su -c "psql test" - postgres 3.32 ;;