Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
agent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a4cee9d8
authored
Mar 05, 2025
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linux install fix
parent
0fe9b30d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
24 deletions
+27
-24
README.md
+24
-18
agent.py
+3
-6
No files found.
README.md
View file @
a4cee9d8
...
...
@@ -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 re
dn
szerekhez is alkatrészek a repóban, de feledésbe merültek...
-
vannak más és régebbi re
nd
szerekhez 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:
\c
ircle
\a
gemt-wdog-winservice.exe
-
c:
\c
ircle
\a
gent-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
...
...
agent.py
View file @
a4cee9d8
...
...
@@ -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
=
0
o755
)
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment