New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0rc1 awesome restart causing systray app issues #3031

Open
3hhh opened this Issue Aug 16, 2017 · 17 comments

Comments

Projects
None yet
5 participants
@3hhh

3hhh commented Aug 16, 2017

The systray apps added in 4.0rc1 do not check at startup whether they are already started.

Thus e.g. a lightdm restart will cause the apps to be started again.

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Aug 16, 2017

/etx/xdg/autostart/qui-devices.desktop
/etx/xdg/autostart/qui-domains.desktop

3hhh commented Aug 16, 2017

/etx/xdg/autostart/qui-devices.desktop
/etx/xdg/autostart/qui-domains.desktop

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Aug 16, 2017

Member
Member

marmarek commented Aug 16, 2017

@3hhh 3hhh changed the title from 4.0rc1 qui-devices & qui-domains multi-start to 4.0rc1 lightdm restart causing issues Aug 16, 2017

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Aug 16, 2017

I renamed it accordingly.

Just also noticed that dispVM instances are not deleted on systemctl restart lightdm.

3hhh commented Aug 16, 2017

I renamed it accordingly.

Just also noticed that dispVM instances are not deleted on systemctl restart lightdm.

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Aug 16, 2017

I agree that it's not common user behavior and should thus only be low prio though.

3hhh commented Aug 16, 2017

I agree that it's not common user behavior and should thus only be low prio though.

@kalkin

This comment has been minimized.

Show comment
Hide comment
@kalkin

kalkin Aug 16, 2017

Member

@3hhh

Thus e.g. a lightdm restart will cause the apps to be started again.

How do you know they're started? Did you see them in ps(1)?

Just also noticed that dispVM instances are not deleted on systemctl restart lightdm.

It's because they're X client instances are not killed and can be recovered by starting qvm-start --gui

Member

kalkin commented Aug 16, 2017

@3hhh

Thus e.g. a lightdm restart will cause the apps to be started again.

How do you know they're started? Did you see them in ps(1)?

Just also noticed that dispVM instances are not deleted on systemctl restart lightdm.

It's because they're X client instances are not killed and can be recovered by starting qvm-start --gui

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Aug 17, 2017

@3hhh

Thus e.g. a lightdm restart will cause the apps to be started again.

How do you know they're started? Did you see them in ps(1)?

Yes, exactly. ps aux | grep python3 or so. Unfortunately I currently cannot test it again as they're not started anymore at all for some reason.

Just also noticed that dispVM instances are not deleted on systemctl restart lightdm.

It's because they're X client instances are not killed and can be recovered by starting qvm-start --gui

Hm ok, that's expected. It would be nice if they'd be cleaned up during Qubes shutdown though as they tend to survive a laptop reboot if I recall correctly.
Unfortunately the last testing repo pull also broke my dispoable VMs so I cannot test that atm neither, sorry...

I'll provide an update once my system is more stable again...

3hhh commented Aug 17, 2017

@3hhh

Thus e.g. a lightdm restart will cause the apps to be started again.

How do you know they're started? Did you see them in ps(1)?

Yes, exactly. ps aux | grep python3 or so. Unfortunately I currently cannot test it again as they're not started anymore at all for some reason.

Just also noticed that dispVM instances are not deleted on systemctl restart lightdm.

It's because they're X client instances are not killed and can be recovered by starting qvm-start --gui

Hm ok, that's expected. It would be nice if they'd be cleaned up during Qubes shutdown though as they tend to survive a laptop reboot if I recall correctly.
Unfortunately the last testing repo pull also broke my dispoable VMs so I cannot test that atm neither, sorry...

I'll provide an update once my system is more stable again...

@kalkin

This comment has been minimized.

Show comment
Hide comment
@kalkin

kalkin Aug 18, 2017

Member

It would be nice if they'd be cleaned up during Qubes shutdown though as they tend to survive a laptop reboot if I recall correctly

They can't survive a reboot. They only survive a X-server restart.

Member

kalkin commented Aug 18, 2017

It would be nice if they'd be cleaned up during Qubes shutdown though as they tend to survive a laptop reboot if I recall correctly

They can't survive a reboot. They only survive a X-server restart.

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Aug 18, 2017

They can't survive a reboot. They only survive a X-server restart.

I'm a tester, not a believer...

Anyway the dispVM issue does not seem to be related to X server restarts - thus I created #3037 for that one.

@Original issue:
It appears to be awesome-specific only.

More precisely it seems to be caused by repeated executions of
dex-autostart -a -e XFCE
(https://github.com/QubesOS/qubes-desktop-linux-awesome/blob/master/awesome-3.5.5-dex-autostart.patch)
during awesome restarts.

Btw my dispVMs started working again after the apps were started again.

3hhh commented Aug 18, 2017

They can't survive a reboot. They only survive a X-server restart.

I'm a tester, not a believer...

Anyway the dispVM issue does not seem to be related to X server restarts - thus I created #3037 for that one.

@Original issue:
It appears to be awesome-specific only.

More precisely it seems to be caused by repeated executions of
dex-autostart -a -e XFCE
(https://github.com/QubesOS/qubes-desktop-linux-awesome/blob/master/awesome-3.5.5-dex-autostart.patch)
during awesome restarts.

Btw my dispVMs started working again after the apps were started again.

@3hhh 3hhh changed the title from 4.0rc1 lightdm restart causing issues to 4.0rc1 awesome restart causing systray app issues Aug 18, 2017

@kalkin

This comment has been minimized.

Show comment
Hide comment
@kalkin

kalkin Aug 18, 2017

Member

@3hhh > More precisely it seems to be caused by repeated executions of

Ohh you mean that error. :) I know about it and this is on my agenda, but it's low priority, because it's not part of the main Qubes project.

I'm a tester, not a believer...

I think I misunderstood you. I thought you mean the X clients of the dispvm survive reboot. Thanks for opening a new issue.

Member

kalkin commented Aug 18, 2017

@3hhh > More precisely it seems to be caused by repeated executions of

Ohh you mean that error. :) I know about it and this is on my agenda, but it's low priority, because it's not part of the main Qubes project.

I'm a tester, not a believer...

I think I misunderstood you. I thought you mean the X clients of the dispvm survive reboot. Thanks for opening a new issue.

@kalkin

This comment has been minimized.

Show comment
Hide comment
@kalkin

kalkin Aug 18, 2017

Member

@3hhh If you have some time, have a look at the Awesome exit Signal. It has a parameter for restart. So you can only execute dex-autostart on startup.

Member

kalkin commented Aug 18, 2017

@3hhh If you have some time, have a look at the Awesome exit Signal. It has a parameter for restart. So you can only execute dex-autostart on startup.

@kalkin

This comment has been minimized.

Show comment
Hide comment
@kalkin

kalkin Aug 21, 2017

Member

@3hhh Looking more in to the exit Signals it seems not to help much. While you find out if awesome is currently restarted on exit, but after restart it will reparse the rc.lua and you are back where you started ☹

Member

kalkin commented Aug 21, 2017

@3hhh Looking more in to the exit Signals it seems not to help much. While you find out if awesome is currently restarted on exit, but after restart it will reparse the rc.lua and you are back where you started ☹

@cyrinux

This comment has been minimized.

Show comment
Hide comment
@cyrinux

cyrinux Aug 21, 2017

Hi, there is the same systray problem with i3. And gui not recevered after a X crash due to low memory for example and relogin.

cyrinux commented Aug 21, 2017

Hi, there is the same systray problem with i3. And gui not recevered after a X crash due to low memory for example and relogin.

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Aug 24, 2017

This fixes it and was tested to work at least with 4.0rc1 even after system crashes (power removed):

--returns true, if the awesome autostart should run (didn't run before already)
local function autostartRequired()
	local lockFilePath = "/tmp/awesome-autostart"
	local lockFile = io.open(lockFilePath,"r")
		if lockFile == nil then

			--create the file
			lockFile = io.open(lockFilePath,"w")
			io.close(lockFile)

			return true
		else
			io.close(lockFile)
			return false
		end
end

--run autostart programs on first boot (awesome restarts won't trigger this)
if autostartRequired() then
	-- Use dex to run the xdg autostart files
	-- for the moment run the ones for XFCE
	awful.util.spawn_with_shell("dex-autostart -a -e XFCE")

	--custom autostart
	-- [...]
end

3hhh commented Aug 24, 2017

This fixes it and was tested to work at least with 4.0rc1 even after system crashes (power removed):

--returns true, if the awesome autostart should run (didn't run before already)
local function autostartRequired()
	local lockFilePath = "/tmp/awesome-autostart"
	local lockFile = io.open(lockFilePath,"r")
		if lockFile == nil then

			--create the file
			lockFile = io.open(lockFilePath,"w")
			io.close(lockFile)

			return true
		else
			io.close(lockFile)
			return false
		end
end

--run autostart programs on first boot (awesome restarts won't trigger this)
if autostartRequired() then
	-- Use dex to run the xdg autostart files
	-- for the moment run the ones for XFCE
	awful.util.spawn_with_shell("dex-autostart -a -e XFCE")

	--custom autostart
	-- [...]
end
@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Sep 8, 2017

The above just didn't work with an X server restart. :-(

Maybe some pgrep solution is more reliable...

3hhh commented Sep 8, 2017

The above just didn't work with an X server restart. :-(

Maybe some pgrep solution is more reliable...

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Sep 15, 2017

The following appears to work:

-- Use dex to run the xdg autostart files
-- for the moment run the ones for XFCE
-- NOTE: awful.util.spawn_with_shell() does some really unpredictable stuff wrt quoting --> you are better off with calling spawn() with your favorite shell and controlling the quoting yourself; still it may not work in awesome, even if it works in your shell
awful.util.spawn('bash -c "pgrep -f -a mqui.tray | grep -v $$ || dex-autostart -a -e XFCE"')

Even minor changes may break it again though due to the unreliable nature of both spawn() and spawn_with_shell() (the latter appears to be even worse).

3hhh commented Sep 15, 2017

The following appears to work:

-- Use dex to run the xdg autostart files
-- for the moment run the ones for XFCE
-- NOTE: awful.util.spawn_with_shell() does some really unpredictable stuff wrt quoting --> you are better off with calling spawn() with your favorite shell and controlling the quoting yourself; still it may not work in awesome, even if it works in your shell
awful.util.spawn('bash -c "pgrep -f -a mqui.tray | grep -v $$ || dex-autostart -a -e XFCE"')

Even minor changes may break it again though due to the unreliable nature of both spawn() and spawn_with_shell() (the latter appears to be even worse).

@kalkin

This comment has been minimized.

Show comment
Hide comment
@kalkin

kalkin Sep 18, 2017

Member

@3hhh Thanks. I will integrate this in my Awesome 4.1 patches QubesOS/qubes-desktop-linux-awesome#10

Member

kalkin commented Sep 18, 2017

@3hhh Thanks. I will integrate this in my Awesome 4.1 patches QubesOS/qubes-desktop-linux-awesome#10

kalkin added a commit to kalkin/qubes-desktop-linux-awesome that referenced this issue Sep 18, 2017

kalkin added a commit to kalkin/qubes-desktop-linux-awesome that referenced this issue Sep 19, 2017

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Apr 7, 2018

For ref: Currently I'm using the method depicted in #3626 to do the autostart.

3hhh commented Apr 7, 2018

For ref: Currently I'm using the method depicted in #3626 to do the autostart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment