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
903c4b05
authored
Mar 05, 2025
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notify fix
parent
1f863982
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
README.md
+5
-2
notify.py
+12
-4
No files found.
README.md
View file @
903c4b05
...
...
@@ -22,17 +22,20 @@ VM kontextualizálását végzi. A felhő menedzserrel egy virtuális soros vona
```
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
*
Célszerűen a cloud usernek van sudo joga jelszó nélkül.
Ha nincs, akkor a /root/.virtualenv/agent és /root/agent katalógusoknak kereshetőknek kell lenniük, és a benne levő
fájloknak olvashatóknak kell lennie a cloud user számára, hogy a vm_reneval működjön.
Ekkor a wm_renewal-bol kivehető a sudo. (Esetleg spec sudo engedéllyel is megoldhato a dolog)
## Windows ##
*
Bundled python alkalmazások, melyekből az első kettő szervízként fut, a harmadik a cloud user belépésekor indul
...
...
notify.py
View file @
903c4b05
...
...
@@ -158,8 +158,9 @@ def open_in_browser(url):
if
display
:
import
webbrowser
webbrowser
.
open
(
url
,
new
=
2
,
autoraise
=
True
)
logger
.
debug
(
"webbrowser.open(
%
s)"
%
url
)
ret
=
webbrowser
.
open
(
url
,
new
=
2
,
autoraise
=
True
)
logger
.
debug
(
"ret:
%
s"
%
ret
)
def
mount_smb
(
url
):
data
=
urlsplit
(
url
)
...
...
@@ -201,6 +202,14 @@ def search_display():
if
env
:
return
env
# guess a logged user name
user
=
"cloud"
try
:
process
=
subprocess
.
run
([
"who"
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
,
encoding
=
"utf-8"
,
timeout
=
5
)
user
=
process
.
stdout
.
split
()[
0
]
except
Exception
:
pass
for
pid
in
os
.
listdir
(
"/proc"
):
if
not
pid
.
isdigit
():
continue
...
...
@@ -209,14 +218,13 @@ def search_display():
with
open
(
env
,
"r"
)
as
f
:
envs
=
dict
(
line
.
split
(
"="
,
1
)
for
line
in
f
.
read
()
.
split
(
"
\0
"
)
if
"="
in
line
)
if
"DISPLAY"
in
envs
and
":"
in
envs
[
"DISPLAY"
]:
if
"DISPLAY"
in
envs
and
":"
in
envs
[
"DISPLAY"
]
and
"USER"
in
envs
and
user
==
envs
[
"USER"
]
:
p
=
os
.
stat
(
os
.
path
.
join
(
"/proc"
,
pid
))
return
envs
[
"DISPLAY"
],
p
.
st_uid
,
p
.
st_gid
except
Exception
:
continue
return
None
if
win
:
from
twisted.internet
import
protocol
from
twisted.protocols
import
basic
...
...
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