GateOne
GateOne copied to clipboard
Gateone doesnt work anymore after dsm 6.0
Since update DSM 6.0-7321 update, gateone isnt working anymore. Services is running, but you can't start gateone.
Error confirmed on my DS414, with DSM 6.0-7321. I did make a clean install with GateOne 20151116-6 and Python 2.7.11-15 (Running just fine).
The wierd thing is here, then running GateOne it going to "stopped" just after loading a bit of time, with the error "Failed to run the package service".
Can't find any information in the log file.
Any fixes?
gateone.log: [I 160407 11:45:39 configuration:711] Gate One settings are incomplete. A new <settings_dir>/10server.conf will be generated. [I 160407 11:45:40 server:4179] Gate One License: AGPLv3 (http://www.gnu.org/licenses/agpl-3.0.html) [I 160407 11:45:40 server:4188] Imported applications: Terminal [I 160407 11:45:40 server:4340] Version: 1.2.0 (20151116212858) [I 160407 11:45:40 server:4341] Tornado version 4.3 [I 160407 11:45:40 server:4361] Connections to this server will be allowed from the following origins: '*' [I 160407 11:45:40 server:4380] No SSL private key found. One will be generated. [I 160407 11:45:50 server:4384] No SSL certificate found. One will be generated. [I 160407 11:46:14 server:3678] No authentication method configured. All users will be ANONYMOUS [I 160407 11:46:14 server:3759] Loaded global plugins: gateone.plugins.editor, gateone.plugins.help
reinstalled python and Gateone also, but now the Gateone service isnt even starting anymore. Above log is the only log i could find.
Anyone from Synocommunity who can check GateOne please and make a fix? I dont like Putty :dash:
@liftoff did you drop the project? can you at least give us some hint on how to debug? I couldn't find any log anywhere.
I think this project may have been abandoned. They haven't responded here or via their commercial page at http://liftoffsoftware.com/Products/GateOne. I was preparing a demo internally and ran into a bug with their RPM, so barring any solution, we'll pursue something else.
I found this:
http://tsu-pe.de/wordpress/synology2/gateone-mit-dsm-6-x-x/
work for me, just copy and past command
@seb972 for me it didn't work.
even after copying the cert and key and installing the two libraries
# I'm already in root (sudo -i) mkdir -p /usr/local/gateone/ssl/ # copy certificate and key cp /usr/syno/etc/certificate/system/default/cert.pem /usr/local/gateone/ssl/server.crt cp /usr/syno/etc/certificate/system/default/privkey.pem /usr/local/gateone/ssl/server.key # install packages /usr/local/python/bin/pip install html5lib tornado # both command succeded (the second one downloaded and installed some stuff)
when I try to run the start script:
/var/packages/gateone/scripts/start-stop-status start
I get:
Starting GateOne …
cp: cannot stat ‘/usr/syno/etc/ssl/ssl.crt/server.crt’: No such file or directory
cp: cannot stat ‘/usr/syno/etc/ssl/ssl.key/server.key’: No such file or directory
su: Permission denied
since this is a permission issue with su command I experimented a bit... (the other two cp error can be ignored, the script is just looking in the wrong position, it is what I supposedly fixed before)
I extracted the actual command executed by the script:
su ${USER} -c "PATH=${PATH} nohup ${PYTHON} ${GATEONE} --settings_dir=${SETTINGS_DIR} > ${INSTALL_DIR}/var/gateone_startup.log &"
Which using these variables:
# Package
PACKAGE="gateone"
DNAME="GateOne"
# Others
INSTALL_DIR="/usr/local/${PACKAGE}"
PYTHON_DIR="/usr/local/python"
PATH="${INSTALL_DIR}/bin:${INSTALL_DIR}/env/bin:${PYTHON_DIR}/bin:${PATH}"
PYTHON="${INSTALL_DIR}/env/bin/python"
GATEONE="${INSTALL_DIR}/env/bin/gateone"
SETTINGS_DIR="${INSTALL_DIR}/var/conf.d"
PID_FILE="${INSTALL_DIR}/var/gateone.pid"
USER="gateone"
Resolve in:
su gateone -c "PATH=/usr/local/gateone/bin:/usr/local/gateone/env/bin:/usr/local/python/bin:${PATH} nohup /usr/local/python/bin/python /usr/local/gateone/env/bin/gateone --settings_dir=/usr/local/gateone/var/conf.d > /usr/local/gateone/var/gateone_startup.log &"
and converted to its sudo version:
sudo -H -u gateone bash -c "PATH=/usr/local/gateone/bin:/usr/local/gateone/env/bin:/usr/local/python/bin:${PATH} nohup /usr/local/python/bin/python /usr/local/gateone/env/bin/gateone --settings_dir=/usr/local/gateone/var/conf.d > /usr/local/gateone/var/gateone_startup.log &"
executing this however doesn't work either because /usr/local/gateone/env/bin/gateone does not exist:
by the way
/usr/local/gateone/var/conf.dalso do not exist
/usr/local/python/bin/python: can't open file '/usr/local/gateone/env/bin/gateone': [Errno 2] No such file or directory
From here, not knowing python nor GateOne I don't know how I am supposed to start it and so I stopped experimenting..
Anyway I think the issue is only with the startup script which try to copy the 2 files (certificates) from the wrong location and use su instead of sudo. No idea about the missing env/bin/gateone tough.
This is the full startup script:
#!/bin/sh
# Package
PACKAGE="gateone"
DNAME="GateOne"
# Others
INSTALL_DIR="/usr/local/${PACKAGE}"
PYTHON_DIR="/usr/local/python"
PATH="${INSTALL_DIR}/bin:${INSTALL_DIR}/env/bin:${PYTHON_DIR}/bin:${PATH}"
PYTHON="${INSTALL_DIR}/env/bin/python"
GATEONE="${INSTALL_DIR}/env/bin/gateone"
SETTINGS_DIR="${INSTALL_DIR}/var/conf.d"
PID_FILE="${INSTALL_DIR}/var/gateone.pid"
USER="gateone"
start_daemon ()
{
# Copy certificate
cp /usr/syno/etc/ssl/ssl.crt/server.crt /usr/syno/etc/ssl/ssl.key/server.key ${INSTALL_DIR}/ssl/
chown ${USER} ${INSTALL_DIR}/ssl/*
su ${USER} -c "PATH=${PATH} nohup ${PYTHON} ${GATEONE} --settings_dir=${SETTINGS_DIR} > ${INSTALL_DIR}/var/gateone_startup.log &"
}
stop_daemon ()
{
su ${USER} -c "PATH=${PATH} ${PYTHON} ${GATEONE} --kill --settings_dir=${SETTINGS_DIR}"
wait_for_status 1 20 || kill -9 `cat ${PID_FILE}`
rm -f ${PID_FILE}
}
daemon_status ()
{
if [ -f ${PID_FILE} ] && kill -0 `cat ${PID_FILE}` > /dev/null 2>&1; then
return
fi
rm -f ${PID_FILE}
return 1
}
wait_for_status ()
{
counter=$2
while [ ${counter} -gt 0 ]; do
daemon_status
[ $? -eq $1 ] && return
let counter=counter-1
sleep 1
done
return 1
}
case $1 in
start)
if daemon_status; then
echo ${DNAME} is already running
else
echo Starting ${DNAME} ...
start_daemon
fi
;;
stop)
if daemon_status; then
echo Stopping ${DNAME} ...
stop_daemon
else
echo ${DNAME} is not running
fi
;;
status)
if daemon_status; then
echo ${DNAME} is running
exit 0
else
echo ${DNAME} is not running
exit 1
fi
;;
log)
echo ${LOG_FILE}
;;
*)
exit 1
;;
esac
Just restarting the NAS after copying the certificates and installing python, would do the trick also for me if the service didnt start.
Interesting additional information to add. Since gateone is not added to /etc/shadow you cannot sudo into it. Since effectively the start-stop-script uses a change of uid to run gateone, that's why you get the su error.
So, after resolving the directories for SSL, additionally you need to add an entry for gateone manually to /etc/shadow. You'll then find it can start.