Open quozl opened 2 years ago
I would like to work on this issue.
@sarthak0527 feel free to open a PR when you have one.
I'm new to open source , could you guide me how can I solve this issue ?
Not really, if we knew how to solve the issue we would just go ahead and do so.
@sarthak0527 a great place to start would be reproducing the issue, you'll have to run it from GNOME though. You'll need to have sugar installed before you run the command above in your terminal.
@chimosky I have installed the sugar . Now what should I do next?
The issue is;
Running
/usr/bin/sugar
from a GNOME Terminal is not something we had planned, but if it is done and the window is closed, Sugar does not exit.
Have you run GNOME Terminal?
When GNOME Terminal is running, have you run /usr/bin/sugar
?
When the Sugar window is closed, what do you observe about the Sugar process?
I did run GNOME Terminal.
After running /usr/bin/sugar , it is running but in system monitor it is not showing .
Also when the sugar window is closed ,I oberserve nothing about the process.
System monitor does not show all processes. The shell command sudo ps ax
may be helpful for listing all processes.
When you say you observe nothing about the process, what do you mean? Does the process exit, or is it still running as described in this issue? You have to be familiar with Linux process creation and termination to be able to detect this issue.
@quozl i would like to work on this
My commiserations to you. Good luck!
Hi there! May I know what was the expected output ?
/usr/bin/sugar
is a shell script derived from bin/sugar.in
, and generates quite a lot of output in various places. The output it generates is not the concern in this issue, it is that the processes run by the shell script do not terminate when an enclosing GNOME Terminal is closed.
/usr/bin/sugar
is a shell script derived frombin/sugar.in
, and generates quite a lot of output in various places. The output it generates is not the concern in this issue, it is that the processes run by the shell script do not terminate when an enclosing GNOME Terminal is closed.
Hmm! as I ran this command in my terminal, I noticed that it changed my cursor style and replaced it with the one in sugar environment, also in the output of ps ax
I see no process of sugar running. Also it keeps the cursor in the same way even the terminal is closed! as i've little experience in linux and it's processes, i would love it if you enlighten me more on this š
Yes, that's right.
Sugar was never intended to be run from any terminal, but rather as an X windows session manager, or the .xsession
file. Sugar does work properly when run in that way.
All logs are kept in .sugar/default/logs
and that's where you can look for an explanation of why Sugar terminated early.
Changing cursor is one of the steps of Sugar startup (src/jarab/main.py
search for cursor-theme), and there is code to put it back the way it was if Sugar is exited normally.
So given your description I'd say Sugar failed to start, and the explanation will be in the logs. That isn't what happened in this issue though.
@chimosky @quozl Hello team,
Please guide me based on my analysis on this issue. I have investigated the issue and have come to the conclusion that the problem lies in the sugar/src/jarabe/main.py file. Specifically, the "_start_window_manager()" function is being called internally and is changing the cursor of the virtual machine without performing verification.
This is why no processes appear to be running even after closing the GNOME terminal but cursor is changed. Upon reviewing the logs, I also noticed that when we trigger Sugar from GNOME terminal, it fails because screen 0 is already in use. However, the root cause of this issue is the cursor change in the code.
To resolve this issue, we could change the cursor only after verifying whether our screen is already in use or not. To further improve these kinds of issue we could use proper error handling (Try and Except Block). I would be happy to contribute more to Sugarlabs.
Best regards, Bhavya Bansal
G'day, and thanks for your input. The problem described is that the process does not exit. The process does continue running. If you think that changing the cursor theme has anything to do with it, then please do test and let us know your result, either here or as a pull request. As for me, I don't see how the cursor theme can cause a process not to exit. I was puzzled as to why you brought it up, then I remembered someone mentioned it. Don't be distracted by comments unrelated to the issue.
Please, in future copy and paste messages or code into the issue rather than use screenshots; your screenshots are (a) not read by a screenreader, (b) not searchable, (c) not visible when reading mail using mutt or high security mail readers. See Creating and highlighting code blocks.
I've checked the mailing list pending administrative actions and there are none. I've checked and your mail address bhavyabansal4321@gmail.com is not subscribed. Please do subscribe.
Thanks for guiding @quozl . I have attached the error logs that we are getting after running Sugar from the GNOME terminal.
(main.py:3327): Wnck-WARNING **: 08:54:39.331: libwnck is designed to work in X11 only, no valid display found
(metacity:3334): metacity-WARNING **: 08:54:39.359: Option ā--no-compositeā is deprecated, use the ā--compositorā instead.
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/jarabe/main.py", line 380, in <module>
main()
File "/usr/lib/python3/dist-packages/jarabe/main.py", line 347, in main
_start_window_manager()
File "/usr/lib/python3/dist-packages/jarabe/main.py", line 208, in _start_window_manager
screen.connect('window-manager-changed', __window_manager_changed_cb)
AttributeError: 'NoneType' object has no attribute 'connect'
(metacity:3334): metacity-WARNING **: 08:54:40.261: Screen 0 on display ":0" already has a window manager; try using the --replace option to replace the current window manager.
So, what I am thinking is, if we could add a validation check at the beginning of our main code to determine whether the screen is a window manager or not, it might help. Right? This way, before executing any process or job, our code will stop its execution."
That's a problem, but it's not this issue. I don't want to talk about it here in this issue. Please take it to another issue or better yet make a pull request to fix it.
@quozl Raised PR, Please Review.
As a data point, the Logout option does terminate the Sugar process on 0.118 on Debian 11 Bullseye.
Running
/usr/bin/sugar
from a GNOME Terminal under X11 is not something we had planned, but if it is done and the window is closed, Sugar does not exit.