From: Adam Dickmeiss Date: Mon, 25 Jan 2010 15:15:11 +0000 (+0100) Subject: Enable default service before (re)starting pazpar2 X-Git-Tag: v1.4.0~167 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=122c504e1d665a4d6a086b47689f8a473775e0bf;p=pazpar2-moved-to-github.git Enable default service before (re)starting pazpar2 Enable default service, default.xml, before starting Pazpar2 only if there is no service already in /etc/pazpar2/services-enabled. --- diff --git a/debian/pazpar2.postinst b/debian/pazpar2.postinst index 46690ae..7bf566b 100644 --- a/debian/pazpar2.postinst +++ b/debian/pazpar2.postinst @@ -4,6 +4,15 @@ set -e if [ "$1" != "configure" ]; then exit 0 fi +# add default.xml if there are no enabled services +no_services=true +for f in /etc/pazpar2/services-enabled/*.xml; do + test -e $f && no_services=false +done +if ${no_services}; then + ln -sf ../services-available/default.xml \ + /etc/pazpar2/services-enabled/default.xml +fi if [ -x "/etc/init.d/pazpar2" ]; then update-rc.d pazpar2 defaults >/dev/null if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then @@ -12,8 +21,6 @@ if [ -x "/etc/init.d/pazpar2" ]; then /etc/init.d/pazpar2 start || exit $? fi fi -ln -sf ../services-available/default.xml \ - /etc/pazpar2/services-enabled/default.xml if [ -f "/etc/pazpar2/pazpar2.cfg" ]; then echo "pazpar2.cfg is obsolete. Pazpar2 uses /etc/pazpar2/server.xml" fi