#761: OGAGent checks for dobule slash before connecting to REST URL.
parent
1cfe9dc9db
commit
65c74510f7
|
@ -30,28 +30,13 @@ install-ogagent:
|
||||||
|
|
||||||
cp -r $(SOURCEDIR)/opengnsys $(LIBDIR)/opengnsys
|
cp -r $(SOURCEDIR)/opengnsys $(LIBDIR)/opengnsys
|
||||||
cp -r $(SOURCEDIR)/cfg $(LIBDIR)/cfg
|
cp -r $(SOURCEDIR)/cfg $(LIBDIR)/cfg
|
||||||
|
ln -fs $(LIBDIR)/cfg/ogagent.cfg $(CFGDIR)
|
||||||
|
ln -fs $(LIBDIR)/cfg/ogclient.cfg $(CFGDIR)
|
||||||
|
|
||||||
# scripts
|
|
||||||
cp scripts/ogagent $(BINDIR)
|
cp scripts/ogagent $(BINDIR)
|
||||||
cp scripts/OGAgentTool-startup $(BINDIR)
|
|
||||||
cp scripts/OGAgentTool $(BINDIR)
|
|
||||||
|
|
||||||
# Fix permissions
|
|
||||||
chmod 755 $(BINDIR)/ogagent
|
chmod 755 $(BINDIR)/ogagent
|
||||||
chmod 755 $(BINDIR)/OGAgentTool-startup
|
|
||||||
chmod 600 $(LIBDIR)/cfg/ogagent.cfg
|
|
||||||
|
|
||||||
# If for red hat based, copy init.d
|
|
||||||
ifeq ($(DISTRO),rh)
|
|
||||||
mkdir -p $(INITDIR)
|
|
||||||
cp debian/ogagent.init $(INITDIR)/ogagent
|
|
||||||
chmod +x $(INITDIR)/ogagent
|
|
||||||
ln -fs /usr/share/OGAgent/cfg/ogagent.cfg $(CFGDIR)
|
|
||||||
ln -fs /usr/share/OGAgent/cfg/ogclient.cfg $(CFGDIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# chmod 0755 $(BINDIR)/ogagent
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -rf $(LIBDIR)
|
rm -rf $(LIBDIR)
|
||||||
# rm -f $(BINDIR)/ogagent
|
rm -f $(BINDIR)/ogagent
|
||||||
rm -rf $(CFGDIR)
|
rm -rf $(CFGDIR)
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Automatically added by dh_installinit
|
|
||||||
if [ -x "/etc/init.d/ogagent" ]; then
|
|
||||||
update-rc.d ogagent defaults >/dev/null || exit $?
|
|
||||||
fi
|
|
||||||
# End automatically added section
|
|
|
@ -1,12 +0,0 @@
|
||||||
# Automatically added by dh_installinit
|
|
||||||
if [ "$1" = "purge" ] ; then
|
|
||||||
update-rc.d ogagent remove >/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# In case this system is running systemd, we make systemd reload the unit files
|
|
||||||
# to pick up changes.
|
|
||||||
if [ -d /run/systemd/system ] ; then
|
|
||||||
systemctl --system daemon-reload >/dev/null || true
|
|
||||||
fi
|
|
||||||
# End automatically added section
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
FOLDER=/usr/share/OGAgent
|
|
||||||
|
|
||||||
cd $FOLDER
|
|
||||||
python OGAgentUser.py $@
|
|
|
@ -1,10 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Simple hack to wait for systray to be present
|
|
||||||
# Exec tool if not already runned by session manager
|
|
||||||
ps -ef | grep "$USER" | grep -v grep | grep -v OGAgentTool-startup | grep 'OGAgentTool' -q
|
|
||||||
# If not already running
|
|
||||||
if [ $? -eq 1 ]; then
|
|
||||||
sleep 5
|
|
||||||
exec /usr/bin/OGAgentTool
|
|
||||||
fi
|
|
|
@ -130,6 +130,8 @@ class OpenGnSysWorker(ServerWorker):
|
||||||
# Replacing server IP if its running on ogLive clinet
|
# Replacing server IP if its running on ogLive clinet
|
||||||
logger.debug('Activating on ogLive client, new server is {}'.format(os.environ['oglive']))
|
logger.debug('Activating on ogLive client, new server is {}'.format(os.environ['oglive']))
|
||||||
url = parse.urlsplit(url)._replace(netloc=os.environ['oglive']).geturl()
|
url = parse.urlsplit(url)._replace(netloc=os.environ['oglive']).geturl()
|
||||||
|
if not url.endswith(os.path.sep):
|
||||||
|
url += os.path.sep
|
||||||
self.REST = REST(url)
|
self.REST = REST(url)
|
||||||
# Get network interfaces until they are active or timeout (5 minutes)
|
# Get network interfaces until they are active or timeout (5 minutes)
|
||||||
for t in range(0, 300):
|
for t in range(0, 300):
|
||||||
|
@ -182,6 +184,24 @@ class OpenGnSysWorker(ServerWorker):
|
||||||
new_hosts_file = hosts_file + '.' + self.interface.ip.split('.')[0]
|
new_hosts_file = hosts_file + '.' + self.interface.ip.split('.')[0]
|
||||||
if os.path.isfile(new_hosts_file):
|
if os.path.isfile(new_hosts_file):
|
||||||
shutil.copyfile(new_hosts_file, hosts_file)
|
shutil.copyfile(new_hosts_file, hosts_file)
|
||||||
|
### Separate in a different function to launch browser while catching disk configuration
|
||||||
|
# Create HTML file (TEMPORARY)
|
||||||
|
message = """
|
||||||
|
<html>
|
||||||
|
<head></head>
|
||||||
|
<body>
|
||||||
|
<h1>Initializing...</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
"""
|
||||||
|
#f = open('/tmp/init.html', 'w')
|
||||||
|
#f.write(message)
|
||||||
|
#f.close()
|
||||||
|
# Launch browser
|
||||||
|
#subprocess.Popen(['browser', '-qws', '/tmp/init.html'])
|
||||||
|
#config = operations.get_configuration()
|
||||||
|
#self.REST.sendMessage('clients/config', {'mac': self.interface.mac, 'ip': self.interface.ip,
|
||||||
|
# 'config': config})
|
||||||
|
|
||||||
def onDeactivation(self):
|
def onDeactivation(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue