diff --git a/oglive/Makefile b/oglive/Makefile index 832e2dc..84e0610 100644 --- a/oglive/Makefile +++ b/oglive/Makefile @@ -30,28 +30,13 @@ install-ogagent: cp -r $(SOURCEDIR)/opengnsys $(LIBDIR)/opengnsys 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/OGAgentTool-startup $(BINDIR) - cp scripts/OGAgentTool $(BINDIR) - - # Fix permissions 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: rm -rf $(LIBDIR) - # rm -f $(BINDIR)/ogagent + rm -f $(BINDIR)/ogagent rm -rf $(CFGDIR) diff --git a/oglive/debian/ogagent-oglive.postinst.debhelper b/oglive/debian/ogagent-oglive.postinst.debhelper deleted file mode 100644 index e75924d..0000000 --- a/oglive/debian/ogagent-oglive.postinst.debhelper +++ /dev/null @@ -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 diff --git a/oglive/debian/ogagent-oglive.postrm.debhelper b/oglive/debian/ogagent-oglive.postrm.debhelper deleted file mode 100644 index 3167f1f..0000000 --- a/oglive/debian/ogagent-oglive.postrm.debhelper +++ /dev/null @@ -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 diff --git a/oglive/scripts/OGAgentTool b/oglive/scripts/OGAgentTool deleted file mode 100644 index 5b30052..0000000 --- a/oglive/scripts/OGAgentTool +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -FOLDER=/usr/share/OGAgent - -cd $FOLDER -python OGAgentUser.py $@ diff --git a/oglive/scripts/OGAgentTool-startup b/oglive/scripts/OGAgentTool-startup deleted file mode 100644 index bb3a848..0000000 --- a/oglive/scripts/OGAgentTool-startup +++ /dev/null @@ -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 \ No newline at end of file diff --git a/src/opengnsys/modules/server/OpenGnSys/__init__.py b/src/opengnsys/modules/server/OpenGnSys/__init__.py index 1e6aedc..45f92cb 100644 --- a/src/opengnsys/modules/server/OpenGnSys/__init__.py +++ b/src/opengnsys/modules/server/OpenGnSys/__init__.py @@ -126,6 +126,8 @@ class OpenGnSysWorker(ServerWorker): # Replacing server IP if its running on ogLive clinet logger.debug('Activating on ogLive client, new server is {}'.format(os.environ['oglive'])) 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) # Get network interfaces until they are active or timeout (5 minutes) for t in range(0, 300): @@ -178,6 +180,24 @@ class OpenGnSysWorker(ServerWorker): new_hosts_file = hosts_file + '.' + self.interface.ip.split('.')[0] if os.path.isfile(new_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 = """ + + + +

Initializing...

+ + +""" + #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): """