Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Roundcube Webmail package add stop option requested #1114

Closed
tuxlagaffe opened this Issue · 5 comments

5 participants

@tuxlagaffe

Hello,

Is it possible to add stop option for Roundcube Webmail package, because at each Mariadb upgrade it is needed to uninstall Roundcube Webmail package because there is no stop option and without it Mariadb upgrade is unpossible.

Thanks in advanced.

Best Regards.

@abraxxa

Same here, please add a solution for that, thanks!

@moneytoo
Owner

To me it looks like unfortunate behaviour of DSM. Just like other web apps, Roundcube has option startable="no" and to have the link active, status has to report it as running.
So either we create real start/stop actions (like other Synology packages) or fake it because startable="no" just can't be used. I don't like neither solution for simple web apps so I try to ping Synology to see what they say.

Until it's resolved, you can edit the exit code of status in /var/packages/roundcube/scripts/start-stop-status from 0 to 1 to work around Mariadb upgrade.

@RustyPixel

@moneytoo MailStation which is synology own roundcude, has status info writen into it's code and that is a web app. So u can't really use "unfortunate behaviour of DSM". here is a extract from MailStation

PACKAGE_DIR="/var/packages/MailStation"
WebMailEnabled="$PACKAGE_DIR/enabled"

    status)
        if [ -f "${WebMailEnabled}" ]; then
            exit 0
        fi
        exit 1
        ;;

Also the same code variant appears in DownloadStation

APP_PATH="/usr/syno/synoman/webman/3rdparty/$PACKAGE_NAME"

    status)
        if [ -e ${APP_PATH} ]; then
            exit 0
        else
            exit 1
        fi
    ;;

The only downside is that i know for one that MailStation never get put into the web dir when installed, but other packages that do get installed there, even if you have a start/stop and stop is set the package is still visiable my solution on this problem was to use .htaccess with the following

# Package
PACKAGE="PACKAGENAME"
WEB_DIR="/var/services/web"
PACKAGE_DIR="/var/packages/${PACKAGE}"
FILE_ENABLE="${PACKAGE_DIR}/enabled"


case $1 in
    start)
        # enable access when set to run
        sed -i '/^deny from all/d' ${WEB_DIR}/${PACKAGE}/.htaccess
        ;;
    stop)
        # block access when set to stop
        echo "deny from all" >> ${WEB_DIR}/${PACKAGE}/.htaccess
        ;;
    status)
        if [ -f "${FILE_ENABLE}" ]; then
            exit 0
        fi
        exit 1
        ;;
    *)
        exit 1
        ;;
esac

also there is another line that get added to .htaccess , if package is not set to run at install level

echo -e "\nErrorDocument 403 \"PACKAGENAME is turned off...\ndeny from all\n" >> ${WEB_DIR}/${PACKAGE}/.htaccess

and before you ask/say about using sed and echo, yes they can be used as again if you check MailStation start-stop-status u will find the RegenConf() which regen mailstation on every start/restart.

@Diaoul
Owner

@RustyPixel: Let's agree this is not a clean way to deal with this issue...
@moneytoo: Any news from Synology on this?

@Diaoul
Owner

Reopen if anything comes up.

@Diaoul Diaoul closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.