Skip to content

Commit

Permalink
core/utils.py: Added a helpful message to killall() to indicate tha…
Browse files Browse the repository at this point in the history
…t it's running and what it is doing.

scripts/init/gateone-debian.sh:  Changed the comment at the top to indicate it should start on runlevel 2 by default.
setup.py:  Modified the systemd installation variables so that they are more descriptive (instead of just re-using the upstart variables).
core/server.py:  Fixed a bug where Gate One could get stuck in an exception loop if a theme file was removed from the cache (by something other than Gate One).
  • Loading branch information
liftoff committed Sep 17, 2014
1 parent f2da78c commit 3674adb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gateone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__version_info__ = (1, 2, 0)
__license__ = "AGPLv3" # ...or proprietary (see LICENSE.txt)
__author__ = 'Dan McDougall <[email protected]>'
__commit__ = "20140914132648" # Gets replaced by git (holds the date/time)
__commit__ = "20140914141029" # Gets replaced by git (holds the date/time)

import os
GATEONE_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down
4 changes: 2 additions & 2 deletions gateone/applications/terminal/static/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1700,15 +1700,15 @@ go.Base.update(GateOne.Terminal, {
where = v.newWorkspace(); // Use the gridwrapper (grid) by default
where.innerHTML = ""; // Empty it out before we use it
where.setAttribute('data-application', 'Terminal'); // Hint for relocateWorkspace()
workspaceNum = parseInt(where.id.split(prefix+'workspace')[1]);
workspaceNum = parseInt(where.getAttribute('data-workspace'));
} else {
where = go.node;
}
} else {
where = u.getNode(where);
if (where.id.indexOf(prefix+'workspace') != -1) {
// This is a workspace, grab the number
workspaceNum = parseInt(where.id.split(prefix+'workspace')[1]);
workspaceNum = parseInt(where.getAttribute('data-workspace'));
}
}
// Create the terminal record scaffold
Expand Down
4 changes: 2 additions & 2 deletions gateone/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
}
__author__ = 'Dan McDougall <[email protected]>'
__commit__ = "20140914132648" # Gets replaced by git (holds the date/time)
__commit__ = "20140914141029" # Gets replaced by git (holds the date/time)

# NOTE: Docstring includes reStructuredText markup for use with Sphinx.
__doc__ = '''\
Expand Down Expand Up @@ -2631,7 +2631,7 @@ def get_theme(self, settings):
theme_mtimes[theme_path] = mtime
modifications = True
# Grab the modification times for each theme file
if modifications:
if modifications or not os.path.exists(cached_theme_path):
logging.debug(_(
"Modification to theme file detected. "
"Theme will be recreated."))
Expand Down
3 changes: 2 additions & 1 deletion gateone/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,9 @@ def killall(session_dir, pid_file):
:pid_file: The path to Gate One's PID file
"""
if not os.path.exists(session_dir):
logging.info("No lieutenant, your processes are already dead.")
logging.info(_("No lieutenant, your processes are already dead."))
return # Nothing to do
logging.info(_("Killing all Gate One processes..."))
sessions = os.listdir(session_dir)
for f in os.listdir('/proc'):
pid_dir = os.path.join('/proc', f)
Expand Down
2 changes: 1 addition & 1 deletion gateone/static/gateone.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/init/gateone-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Provides: gateone
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 3 4 5
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Starts and stops Gate One
### END INIT INFO
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def which(binary, path=None):
init_script = []
conf_file = [] # Only used on Gentoo
upstart_file = [] # Only used on Ubuntu (I think)
systemd_file = [] # Only used on systems with systemd
debian_script = os.path.join(setup_dir, 'scripts/init/gateone-debian.sh')
redhat_script = os.path.join(setup_dir, 'scripts/init/gateone-redhat.sh')
freebsd_script = os.path.join(setup_dir, 'scripts/init/gateone-freebsd.sh')
Expand Down Expand Up @@ -114,7 +115,7 @@ def which(binary, path=None):
# This pkg-config command tells us where to put systemd .service files:
retcode, systemd_system_unit_dir = getstatusoutput(
'pkg-config systemd --variable=systemdsystemunitdir')
upstart_file = [systemd_system_unit_dir, [systemd_temp_path]]
systemd_file = [systemd_system_unit_dir, [systemd_temp_path]]
# Handle FreeBSD and regular init.d scripts
if os.path.exists(bsd_temp_script):
init_script = ['/usr/local/etc/rc.d', [bsd_temp_script]]
Expand Down Expand Up @@ -215,6 +216,8 @@ def fullsplit(path, result=None):
data_files.append(conf_file)
if upstart_file:
data_files.append(upstart_file)
if systemd_file:
data_files.append(systemd_file)
else:
print("You are not root; skipping installation of init scripts.")

Expand Down

0 comments on commit 3674adb

Please sign in to comment.