Commit a4cee9d8 by Szeberényi Imre

Linux install fix

parent 0fe9b30d
......@@ -8,25 +8,31 @@ VM kontextualizálását végzi
- /usr/bin/vm_renewal
- /etc/systemd/system/agent.service
### tesztelve ***
### tesztelve ###
- ubuntu 18.04, 20.04, 22.04, 24.04
- vannak más és régebbi rednszerekhez is alkatrészek a repóban, de feledésbe merültek...
- vannak más és régebbi rendszerekhez is alkatrészek a repóban, de feledésbe merültek...
### Linux install ###
* Feltételezzuk, hogy van python3 és virtualenv, ha nincs:
* Feltételezzük, hogy van *git*, *python3*, *virtualenv* és *ifupdown*, ha nincs:
- sudo apt install git
- sudo apt install python3
- sudp apt install virtualenvwrapper
* sudo -i
* cd /root
* chmod oug+x .
* mkvirtualenv agent
* workon agent
* git clone https://git.ik.bme.hu/CIRCLE3/agent.git
* chmod oug+rx agent
* cd agent
* python agent.py --install
- bemasolja az agent.service-t /etc/systemd -be, engedélyezi, de nem indítja el
- bemasolja a vm_renewal-t a /usr/bin/ -be
- sudo apt install virtualenvwrapper
- sudo apt install ifupdown # elvileg együtt tud élni a Network Managerrel
* Majd:
```
sudo -i
cd /root
chmod oug+x . # fontos a pont!
mkvirtualenv agent
workon agent
git clone https://git.ik.bme.hu/CIRCLE3/agent.git
chmod oug+rx agent
cd agent
python agent.py --install
```
* Ez utóbbi parancs
- bemásolja az agent.service-t /etc/systemd/system -be, engedélyezi, de nem indítja el
- bemásolja a vm_renewal-t a /usr/bin/ -be
## Windows ##
* Bundled python alkalmazások, melyekből az első kettő szervízként fut, a harmadik a clud user belépésekor indul
......@@ -35,7 +41,7 @@ VM kontextualizálását végzi
- c:\circle\agemt-wdog-winservice.exe
- c:\circle\agent-notify.exe
### tesztelve ***
### tesztelve ###
- windows 10, 11
- Win7-re az ez a verzió nem megy fel. Régit kell hazsnálni.
......@@ -60,10 +66,10 @@ VM kontextualizálását végzi
* cloud
### hálózat ###
* ubuntu alatt a ```/etc/network/interfaces``` fájlt piszkálja
* ubuntu alatt a ```/etc/network/interfaces``` fájlt piszkálja **TODO**: ifupdown elfelejtése
### DNS ###
* Linux alatt még a ```resolv.conf```-ot piszkálja **TODO**
* Linux alatt még a ```resolv.conf```-ot piszkálja **TODO**: átállás systemd-resolved -re
#### SMBFS ####
* mindenhol case insensitive, kiveve a /etc/nsmb.conf-ban es a ~/.nsmbrc-ben, itt a userneveket szigoruan upper-case kell irni
......
......@@ -6,6 +6,7 @@ import logging
import platform
import subprocess
import sys
from shutil import rmtree
logging.basicConfig(
format="[%(asctime)s] %(levelname)s [agent %(process)d/%(thread)d] %(module)s.%(funcName)s:%(lineno)d] %(message)s",
......@@ -18,8 +19,7 @@ logger.setLevel(level)
system = platform.system() # noqa
logger.debug("system:%s", system)
def linux_install:
if len(sys.argcv) != 1 and (system == "Linux" or system == "FreeBSD"): # noqa
logger.info("Installing agent on %s system", system)
try: # noqa
chdir(sys.path[0]) # noqa
......@@ -28,7 +28,7 @@ def linux_install:
copy_file("misc/vm_renewal", "/usr/bin/vm_renewal", mode=0o755)
if copy_file("misc/agent.service", "/etc/systemd/system/agent.service"):
subprocess.call(('systemctl', 'enable', 'agent'))
shutil.rmtree('win_exe')
rmtree('win_exe', ignore_errors=True)
except Exception as e: # noqa
logger.exception("Unhandled exeption: %s", e)
pass # hope it works # noqa
......@@ -207,9 +207,6 @@ class SerialLineReceiver(SerialLineReceiverBase):
pass
def main():
if system == "Linux" or system == "FreeBSD": # noqa
if len(sys.argv) != 1 and (if (sys.argv[1] == "-i" or sys.argv[1] "--install"):
linux_install()
# Get proper serial class and port name
(serial, port) = get_serial()
logger.info("Opening port %s", port)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment