Systemd script for Debian 9 or 10, with postgresql 11 or not.
This commit is contained in:
parent
2ee1a386b9
commit
c3e5a5d188
@ -34,9 +34,11 @@ export POSTGRES_USER=www-data
|
|||||||
if [ "${debian_version}" = "10" ]
|
if [ "${debian_version}" = "10" ]
|
||||||
then
|
then
|
||||||
PSQL=/usr/lib/postgresql/11/bin/psql
|
PSQL=/usr/lib/postgresql/11/bin/psql
|
||||||
|
export POSTGRES_SERVICE="postgresql@11-main.service"
|
||||||
elif [ "${debian_version}" = "9" ]
|
elif [ "${debian_version}" = "9" ]
|
||||||
then
|
then
|
||||||
PSQL=/usr/lib/postgresql/9.6/bin/psql
|
PSQL=/usr/lib/postgresql/9.6/bin/psql
|
||||||
|
export POSTGRES_SERVICE="postgresql"
|
||||||
elif [ "${debian_version}" = "8" ]
|
elif [ "${debian_version}" = "8" ]
|
||||||
then
|
then
|
||||||
PSQL=/usr/lib/postgresql/9.4/bin/psql
|
PSQL=/usr/lib/postgresql/9.4/bin/psql
|
||||||
|
@ -8,7 +8,13 @@ source utils.sh
|
|||||||
check_uid_root $0
|
check_uid_root $0
|
||||||
|
|
||||||
echo 'Installation du demarrage automatique de ScoDoc (systemd)'
|
echo 'Installation du demarrage automatique de ScoDoc (systemd)'
|
||||||
cp $SCODOC_DIR/config/etc/scodoc.service /etc/systemd/system
|
|
||||||
|
# La variable POSTGRES_SERVICE doit être positionnée dans config.sh
|
||||||
|
# suivant la version de Debian et de postgresql
|
||||||
|
[ -z "${POSTGRES_SERVICE}" ] && die "incompatible Debian version"
|
||||||
|
|
||||||
|
cat "$SCODOC_DIR/config/etc/scodoc.service" | sed 's/{{postgresql}}/'"${POSTGRES_SERVICE}"'/g' > /etc/systemd/system/scodoc.service
|
||||||
|
|
||||||
systemctl enable scodoc.service
|
systemctl enable scodoc.service
|
||||||
|
|
||||||
echo "A partir de maintenant, utiliser"
|
echo "A partir de maintenant, utiliser"
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
# ScoDoc7 service
|
# ScoDoc7 service
|
||||||
# Zope based
|
# Zope based
|
||||||
# Depends on postgresql
|
# Depends on {{postgresql}} (replaced by installation script by
|
||||||
# => is restarted when postgresql restarts
|
# postgresql@11-main.service on Debian 10
|
||||||
|
# postgresql on Debian <= 9
|
||||||
|
# => is restarted when {{postgresql}} restarts
|
||||||
#
|
#
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=ScoDoc 7 service
|
Description=ScoDoc 7 service
|
||||||
After=network.target postgresql
|
After=network.target {{postgresql}}
|
||||||
Requires=postgresql
|
Requires={{postgresql}}
|
||||||
PartOf=postgresql
|
PartOf={{postgresql}}
|
||||||
StartLimitIntervalSec=0
|
StartLimitIntervalSec=0
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
@ -21,4 +23,4 @@ ExecStop=/opt/scodoc/bin/zopectl stop
|
|||||||
ExecReload=/opt/scodoc/bin/zopectl restart
|
ExecReload=/opt/scodoc/bin/zopectl restart
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=postgresql
|
WantedBy={{postgresql}}
|
||||||
|
@ -220,9 +220,7 @@ read ans
|
|||||||
if [ "$(norm_ans "$ans")" != 'N' ]
|
if [ "$(norm_ans "$ans")" != 'N' ]
|
||||||
then
|
then
|
||||||
# ScoDoc 7.19+ uses systemd
|
# ScoDoc 7.19+ uses systemd
|
||||||
echo 'Installation du demarrage automatique de ScoDoc (systemd)'
|
$SCODOC_DIR/config/configure_systemd.sh
|
||||||
cp $SCODOC_DIR/config/etc/scodoc.service /etc/systemd/system
|
|
||||||
systemctl enable scodoc.service
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user