debian/cubicweb-ctl.cubicweb.init
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 05 Jul 2010 18:25:19 +0200
changeset 5891 99024ad59223
parent 3001 74e842e4871a
child 6803 691dac4c6a05
permissions -rw-r--r--
[schema migration] import refactoring to fix #1109558 and enhances things on the way the main pb demonstrated by #1109558 was due to the fact that in-memory schema was updated in commit_event of operations. This is undesired in most cases, since we want the modification to be taken into account in the interval between the modification detection and the commit_event. I've fixed this by merging in-memory schema / database alteration operations for most important changes, doing in-memory schema changes as they are detected and implementing a revertcommit_event method to revert them if necessary (with exception for removal of stuff from the schema, where this is simply done in a postcommit_event methods). Also, I've benefited from this to support reverting of database alteration for some operations (more to be done there), and to move so system source alteration code to the native source code for a nicer design. There may be some more stuff in syncschema.py that would benefit from similar changes, but most important things are done (at least to close #1109558, w/ unittest_syncschema and unittest_migration green).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
#!/bin/sh -e
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
### BEGIN INIT INFO
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     4
# Provides:          cubicweb
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     5
# Required-Start:    $syslog $local_fs $network
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     6
# Required-Stop:     $syslog $local_fs $network
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
# Should-Start:      $postgresql $pyro-nsd
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
# Should-Stop:       $postgresql $pyro-nsd
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     9
# Default-Start:     2 3 4 5
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
# Default-Stop:      0 1 6
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    11
# Short-Description: Start cubicweb application at boot time
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
### END INIT INFO
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    13
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    14
# FIXME Seems to be inadequate here
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    15
# FIXME If related to pyro, try instead:
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    16
# export PYRO_STORAGE="/tmp"
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    17
cd /tmp
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    18
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    19
# FIXME Work-around about the following lintian error
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    20
#     E: cubicweb-ctl: init.d-script-does-not-implement-required-option /etc/init.d/cubicweb start
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    21
#
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    22
# Check if we are sure to not want the start-stop-daemon machinery here
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    23
# Refer to Debian Policy Manual section 9.3.2 (Writing the scripts) for details.
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    24
3001
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    25
case $1 in
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    26
    force-reload)
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    27
        /usr/bin/cubicweb-ctl reload --force
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    28
        ;;
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    29
    status)
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    30
        /usr/bin/cubicweb-ctl status
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    31
        ;;
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    32
    *)
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    33
        /usr/bin/cubicweb-ctl $1 --force
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    34
        ;;
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 0
diff changeset
    35
esac