debian/cubicweb-ctl.cubicweb.init
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 03 Jul 2013 14:33:27 +0200
branchstable
changeset 9130 0f1504a9fb51
parent 7788 cc8670be7b2e
child 10235 684215aca046
permissions -rw-r--r--
[constraint] more robust unicity constraint failures reporting for end-users Postgres or Sqlserver have limits on the index names (around resp. 64 and 128 characters). Because `logilab.database` encodes the `unique together` constraint rtypes in the index names, we sometimes get truncated index names, from which it is impossible to retrieve all rtypes. In the long run, the way such index are named should be changed. In the short term, we try to reduce the end-user confusion resulting from this design flaw: * in source/native, the regex filtering ``IntegrityError`` message does not impose an `_idx` suffix, which indeed may be absent (the result being an UI message that resembles a catastrophic failure), * also we avoid including a trailing " (double quote) from the error message * in entities/adapters, the well-named ``IUserFriendly`` adapter is made a bit smarter about how to handle missing rtypes. * the adapter also always produces a global message explaining the issue (and the fact that sometimes, the user is not shown all the relevant info) * i18n is updated Closes #2793789
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
6917
e080e7465ac4 [debian] fix lintian errors
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 6803
diff changeset
     5
# Required-Start:    $remote_fs $syslog $local_fs $network
e080e7465ac4 [debian] fix lintian errors
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 6803
diff changeset
     6
# Required-Stop:     $remote_fs $syslog $local_fs $network
7788
cc8670be7b2e [debian] fix init script dependencies (closes #1921729)
Julien Cristau <julien.cristau@logilab.fr>
parents: 6917
diff changeset
     7
# Should-Start:      postgresql pyro-nsd
cc8670be7b2e [debian] fix init script dependencies (closes #1921729)
Julien Cristau <julien.cristau@logilab.fr>
parents: 6917
diff changeset
     8
# Should-Stop:       postgresql pyro-nsd
0
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)
6803
691dac4c6a05 [c-c] #1193302: Only show Deprecation warnings when using cubicweb-ctl (not /etc/init.d/cubicweb)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3001
diff changeset
    27
        python -W ignore /usr/bin/cubicweb-ctl reload --force
3001
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)
6803
691dac4c6a05 [c-c] #1193302: Only show Deprecation warnings when using cubicweb-ctl (not /etc/init.d/cubicweb)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3001
diff changeset
    30
        python -W ignore /usr/bin/cubicweb-ctl status
3001
74e842e4871a B fix the cubicweb init script
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 858
diff changeset
    31
        ;;
6917
e080e7465ac4 [debian] fix lintian errors
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 6803
diff changeset
    32
    start|stop|restart|*)
6803
691dac4c6a05 [c-c] #1193302: Only show Deprecation warnings when using cubicweb-ctl (not /etc/init.d/cubicweb)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3001
diff changeset
    33
        python -W ignore /usr/bin/cubicweb-ctl $1 --force
3001
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