Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xfce, init is deactivating xscreensaver every 20 sec.
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
k9dog
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jun 2009
Posts: 103
Location: Denmark

PostPosted: Thu Feb 15, 2018 2:37 am    Post subject: xfce, init is deactivating xscreensaver every 20 sec. Reply with quote

Hi I'm having some trouble that init is deactivating xscreensaver (through xscreensaver-command) every 20 sec. I managed to track down the error and stopping init from interrupting the screensaver by replacing /usr/bin/xscreensaver-command with a script that shows init [3] to be the launching program and the options to be -deactivate.
I checked my configuration and I can't find anything that might cause this behaviour. Even testing a screen saver is broken. Replacing xscreensaver-command with a script made screen saver work again, but might interfere with other operations, so I'd prefer if I could track down the source (have another Gentoo setup where it is not an issue and think it turned up around the time where I changed from nouveau to legacy nvidia v304 driver and 4.9 kernel, but it might not be related as I also updated the system and did various changes).
So what I know is init calls xscreensaver-command -deactivate every 20 seconds.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Thu Feb 15, 2018 7:33 am    Post subject: Reply with quote

Well, I doubt init is actually starting it; it's probably some other program disowning the deactivate command, and init ends up being the parent to all disowned child processes.

Now the question is what else are you running - what desktop environment, what other programs that could desire to disable the screensaver.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
k9dog
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jun 2009
Posts: 103
Location: Denmark

PostPosted: Thu Feb 15, 2018 9:56 pm    Post subject: Reply with quote

eccerr0r wrote:
Well, I doubt init is actually starting it; it's probably some other program disowning the deactivate command, and init ends up being the parent to all disowned child processes.

Now the question is what else are you running - what desktop environment, what other programs that could desire to disable the screensaver.


Bit verbose output, but here is a bit cut down version of log and my script (script first):
(original xscreensaver-command has a.org added. Firefox cut as I get same result if it
s not running)

/usr/bin/xscreensaver-command replacent (original .org extension):
Code:
#!/bin/bash

PARENT_COMMAND="$(ps -o args= $PPID)"

if [ -n /root ] ; then
  date > /root/xscreensaver-command-pid.txt
  echo "$PARENT_COMMAND" >> /root/xscreensaver-command-pid.txt
  echo "$@" >> /root/xscreensaver-command-pid.txt
  pstree -l -p >> /root/xscreensaver-command-pid.txt
fi
if [ -n /home/jk ] ; then
  date > /home/jk/xscreensaver-command-pid.txt
  echo "$PARENT_COMMAND" >> /home/jk/xscreensaver-command-pid.txt
  echo "$@" >> /home/jk/xscreensaver-command-pid.txt
  pstree -l -p >> /home/jk/xscreensaver-command-pid.txt
fi
/root/xscreensaver-command.org ""


log (from /home/jk/xsceensaver-command-log.txt) [danish date. firefox cut from log]
Code:
tor 15 feb 22:48:53 CET 2018
init [3]
-deactivate
init(1)-+-ModemManager(8889)-+-{ModemManager}(8915)
        |                    `-{ModemManager}(8930)
        |-NetworkManager(8640)-+-dhclient(20252)
        |                      |-{NetworkManager}(8641)
        |                      `-{NetworkManager}(8655)
        |-agetty(12280)
        |-agetty(12281)
        |-agetty(12282)
        |-agetty(12283)
        |-agetty(12284)
        |-agetty(12285)
        |-at-spi-bus-laun(12545)-+-dbus-daemon(12550)
        |                        |-{at-spi-bus-laun}(12546)
        |                        |-{at-spi-bus-laun}(12547)
        |                        `-{at-spi-bus-laun}(12549)
        |-at-spi2-registr(12552)-+-{at-spi2-registr}(12555)
        |                        `-{at-spi2-registr}(12557)
        |-automount(10711)-+-{automount}(10716)
        |                  `-{automount}(10717)
        |-avahi-daemon(10943)---avahi-daemon(10947)
        |-console-kit-dae(12508)-+-{console-kit-dae}(12509)
        |                        |-{console-kit-dae}(12511)
        |                        |-{console-kit-dae}(12512)
        |                        `-{console-kit-dae}(12513)
        |-cupsd(11104)
        |-dbus-daemon(8426)
        |-dbus-daemon(12527)
        |-dbus-launch(12526)
        |-gpg-agent(12565)
        |-gpm(11274)
        |-gvfs-mtp-volume(12902)-+-{gvfs-mtp-volume}(12904)
        |                        `-{gvfs-mtp-volume}(12906)
        |-gvfs-udisks2-vo(12875)-+-{gvfs-udisks2-vo}(12876)
        |                        `-{gvfs-udisks2-vo}(12877)
        |-gvfsd(12540)-+-{gvfsd}(12541)
        |              `-{gvfsd}(12542)
        |-gvfsd-metadata(12922)-+-{gvfsd-metadata}(12926)
        |                       `-{gvfsd-metadata}(12927)
        |-gvfsd-trash(12909)-+-{gvfsd-trash}(12910)
        |                    `-{gvfsd-trash}(12911)
        |-named(18586)-+-{named}(18587)
        |              |-{named}(18588)
        |              |-{named}(18589)
        |              `-{named}(18590)
        |-nmbd(18658)
        |-polkitd(8870)-+-{polkitd}(8895)
        |               |-{polkitd}(8903)
        |               |-{polkitd}(8920)
        |               `-{polkitd}(8927)
        |-pulseaudio(12570)-+-{pulseaudio}(12575)
        |                   |-{pulseaudio}(12576)
        |                   `-{pulseaudio}(12577)
        |-rtkit-daemon(12572)-+-{rtkit-daemon}(12573)
        |                     `-{rtkit-daemon}(12574)
        |-slim(12210)-+-X(12218)---{X}(12289)
        |             `-ck-launch-sessi(12488)---sh(12523)---sh(12528)---xfce4-session(12536)-+-Thunar(12581)-+-{Thunar}(12582)
        |                                                                                     |               `-{Thunar}(12583)
        |                                                                                     |-nm-applet(12884)-+-{nm-applet}(12916)
        |                                                                                     |                  |-{nm-applet}(12918)
        |                                                                                     |                  `-{nm-applet}(12930)
        |                                                                                     |-polkit-gnome-au(12894)-+-{polkit-gnome-au}(12920)
        |                                                                                     |                        `-{polkit-gnome-au}(12924)
        |                                                                                     |-xfce4-panel(12584)-+-panel-12-power-(12696)-+-{panel-12-power-}(12757)
        |                                                                                     |                    |                        `-{panel-12-power-}(12758)
        |                                                                                     |                    |-panel-16-mixer(12727)-+-{panel-16-mixer}(12759)
        |                                                                                     |                    |                       |-{panel-16-mixer}(12760)
        |                                                                                     |                    |                       `-{panel-16-mixer}(12792)
        |                                                                                     |                    |-panel-2-actions(12688)-+-{panel-2-actions}(12766)
        |                                                                                     |                    |                        `-{panel-2-actions}(12767)
        |                                                                                     |                    |-panel-6-systray(12682)-+-{panel-6-systray}(12770)
        |                                                                                     |                    |                        `-{panel-6-systray}(12771)
        |                                                                                     |                    |-{xfce4-panel}(12595)
        |                                                                                     |                    `-{xfce4-panel}(12596)
        |                                                                                     |-xfdesktop(12847)-+-{xfdesktop}(12858)
        |                                                                                     |                  `-{xfdesktop}(12859)
        |                                                                                     |-xfwm4(12566)-+-{xfwm4}(12578)
        |                                                                                     |              |-{xfwm4}(12579)
        |                                                                                     |              `-{xfwm4}(12580)
        |                                                                                     |-xscreensaver(12885)
        |                                                                                     |-{xfce4-session}(12537)
        |                                                                                     `-{xfce4-session}(12538)
        |-smbd(18609)-+-cleanupd(18624)
        |             |-lpqd(18651)
        |             `-smbd-notifyd(18623)
        |-ssh-agent(12563)
        |-sshd(9740)
        |-syslog-ng(9441)---syslog-ng(9442)-+-{syslog-ng}(28473)
        |                                   `-{syslog-ng}(28474)
        |-udevd(3738)
        |-udisksd(12879)-+-{udisksd}(12880)
        |                |-{udisksd}(12882)
        |                |-{udisksd}(12889)
        |                `-{udisksd}(12897)
        |-upowerd(12673)-+-{upowerd}(12678)
        |                `-{upowerd}(12679)
        |-vsftpd(18672)
        |-wpa_supplicant(8882)
        |-xfce4-notifyd(12914)-+-{xfce4-notifyd}(12928)
        |                      `-{xfce4-notifyd}(12929)
        |-xfce4-power-man(12883)-+-{xfce4-power-man}(12886)
        |                        `-{xfce4-power-man}(12887)
        |-xfce4-terminal(21784)-+-bash(21788)---medianas-jk(21797)---ssh(21798)
        |                       |-bash(21888)---medianas-jk(21894)---ssh(21895)
        |                       |-bash(22550)---su(22589)---bash(22595)
        |                       |-{xfce4-terminal}(21785)
        |                       `-{xfce4-terminal}(21786)
        |-xfconfd(12554)-+-{xfconfd}(12556)
        |                `-{xfconfd}(12558)
        |-xfsettingsd(12597)-+-xfce4-appfinder(19277)-+-{xfce4-appfinder}(19278)
        |                    |                        `-{xfce4-appfinder}(19279)
        |                    |-{xfsettingsd}(12603)
        |                    `-{xfsettingsd}(12604)
        `-xscreensaver-co(28476)---pstree(28481)
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Fri Feb 16, 2018 12:16 am    Post subject: Reply with quote

If you insist init is running it, check your /etc/inittab and make sure it's not running it.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Fri Feb 16, 2018 2:10 am    Post subject: Reply with quote

As eccerr0r says, post the output of cat -n /etc/inittab. My guess would be that whatever process runs it is forking, then forking again, then the first level child exits (reparenting the seconnd-level child to init), then the second-level child executes /usr/bin/xscreensaver-command.

Also, your wrapper script has a bug. You do not forward to the real program the arguments that were passed to your wrapper.
Back to top
View user's profile Send private message
k9dog
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jun 2009
Posts: 103
Location: Denmark

PostPosted: Fri Feb 16, 2018 6:41 am    Post subject: Reply with quote

@Hu: My wrapper was to dig into what was going on. What I see is -deactivate every 20 sec. I've seen init and no other program calling the xss-cmd. My wrapper could at least look for init and the option to deactivate if I plan expanding it. I am not sure what else I could look for, but I was not planning to leave wrapper there for ever, just until I find the scoundrel program or otherwise remove the cause.

@eccerr0r: I am not saying init is the problem, I think init is just the messenger. I suspect one of the programs init is running somehow is asking system to disable powersave and screensaver. Without wrapper screensaver doesn't work at all (I tried 2 versions of xscreensaver). I'm pretty sure xscreensaver is asked though init, but I think whatever system element triggers the request, does it through init and I'm not sure how to debug init to tell me which element. I haven't modified my init script (etc-update might), but I'll post it if you want.

I also got caffeine installed (layman seeds). I tried uninstalling it and still had the issue. Caffeine can still disable the screensaver even with the wrapper. If I consider my use flags, maybe I'll try pulling out the upower and launching emerge world again. Most power options seem to work badly with my nvidia v304 anyway (hibernate/sleep), so I don't expect to miss it. From what I read it is the old nvidia hardware that was causing these power save problems (not related to xss-cmd, but maybe disabling power save can remove problem). I think it did work with nouveau and I think screensaver did before I turned my system into nvidia driver based, but the nvidia driver is very fast (can run wine games / vlc without a hitch) and the setup put most Windows installations to shame. If this is the issue it might only show with old legacy drivers as required by my system.
To save power my kernel is slowing cpu and putting that to sleep. I got sensors installed to lower fan speed. It is all very console and kernel based, but it might be another place to look. I'd prefer not disabling too much of it as it does save power.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Fri Feb 16, 2018 7:20 am    Post subject: Reply with quote

What I'm saying is that it's not likely the problem, nor is it even the messenger - more of the trash can. There's no way to tell who threw it in the trash, other than someone ditched it.

Not only that, EVERY single (user) process is a child of init! (kernel processes are a bit different, I think... but irrelevant for this problem.)

Do you have xfce-power-manager changing power options?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
k9dog
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jun 2009
Posts: 103
Location: Denmark

PostPosted: Fri Feb 16, 2018 12:04 pm    Post subject: Reply with quote

I am not sure why script says calling process was init, but I think that is actually more due to screenblanker being started by init. My script gave the calling parameters, but the launching program might have been a false indicator.
I must say that the upowerd listed did make me think it was causing the problem. While this might not have been 100% the case adding -upower to make.conf, unmerging most power related stuff and re-emerging did help (didn't trigger much rebuild after I had removed power saving programs.
Script isn't needed any more. There is no attempts from system to deactivate screen blanker.
I replaced xscreensaver-command with the original and not having the problem any more (with or without script).
I told screensaver to use a turn off screen and that worked too. So screen goes blank at 2 minutes and turns off after 5.
So there is no longer an issue.
I un-emerged most power saving tools and anything directly related to powerd. xfce-power-manager was unmerged too before I read your last post.
Caffinate works.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Sat Feb 17, 2018 12:34 am    Post subject: Reply with quote

k9dog wrote:
I am not sure why script says calling process was init, but I think that is actually more due to screenblanker being started by init.
This is unlikely. I think the explanation suggested by both me and by eccerr0r is more likely. Some unknown program P starts a child process, then exits, then the child is reparented to init, then the child executes xscreensaver-command. Your hook then reports its current parent (init), not its original parent (the now dead and gone P).
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Sat Feb 17, 2018 2:24 am    Post subject: Reply with quote

xfce-power-manager also has controls to deal with screen blanking; if you had that set to disable blanking, then that could possibly be the problem. I don't know how xfce4 handles controlling screen blanking though its default screensaver is xscreensaver, quite possibly it executes a command to ping the xscreensaver daemon to ensure the screen doesn't go blank.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
k9dog
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jun 2009
Posts: 103
Location: Denmark

PostPosted: Sat Feb 17, 2018 2:26 pm    Post subject: Reply with quote

Hu wrote:
k9dog wrote:
I am not sure why script says calling process was init, but I think that is actually more due to screenblanker being started by init.
This is unlikely. I think the explanation suggested by both me and by eccerr0r is more likely. Some unknown program P starts a child process, then exits, then the child is reparented to init, then the child executes xscreensaver-command. Your hook then reports its current parent (init), not its original parent (the now dead and gone P).


Thought I was agreeing with eccerrOr saying it wasn't init giving the xscreensaver-command the message (using commandline) to deactivate and as I see it now it isn't how it works (lol). I also misunderstood him a bit. init is xscreensavers ancestor and I still think that's why it was showing up in log. I think I said it was started by init. Which only is true in the way that all (or at least most processes not started by user) starts with init as a parent or some other ancestor. Soo yeah that was pretty much nonsense what I said.

Please read my "started by init" as "started with init as a parent/ancestor process". If I said something was started by init, my lack of knowledge about that part probably showed. Init does start things, because thats what it do besides waiting (not sure init is a singular thing, but was mostly talking about why it shows up as process in log). I didn't mean to imply it started anything on its its own. I did think it had some way to relay messages. If it does it's probably very basic stuff.

The xscreensaver is started during startup of X11/xfce. While started with init as a ancestor (init is pretty much root of other daemons and other initial one shot processes as I understand it which I guess all the fuss was about)

You can kill xscreensaver and blanking will stop. You can start it again and it will resume to blank.
I imagine that xscreensaver looks for mouse and keyboard events itself.
The xscreensaver-command can control xscreensaver from other programs (not the method used by all programs, but was in my case).

I guess that xfce-power-manager was the one asking (from my own settings somehow) to deactivate power/screensaver.
eccerrOr pointed to it having its own settings including option to turn off screen saver. I do remember checking those settings too. I don't remember if I turned off screen saver there, but power options was (might have restricted settings too much).

I did use power saving for hibernate and sleep. I might have triggered the behaviour when I changed from nouveau to nvidia legacy driver. Before issue with xscreensaver, the driver failed to restore screen and things got messed up, so I did turn off power saving in both settings for screen saver and power saving in xfce-power-manager. I'm not sure what I did with screen blanker in power settings. Would be nice if they worked from same set of settings, but they might not have been.

What I believe now is that xfce-power-manager wasn't set up correctly and spammed xscreensaver to deactivate through it's helper. I can't say for sure. In any case I don't need power saving beyond what nvidia driver allow, which is pretty much limited to screen-standby on this laptop, so I removed power managers and it took away the symptom.

I think settings tools would have benefited from being a bit more connected if they allow contradictions (Read "if").

Originally it was powerd process that made me think I could remove things related to power saving on my system and knowing already it was tied into the screen saver part it was the first thing I disabled. It might not have been the direct reason, but at the time I didn't have a given reason for the screen saver fail, so since I didn't need it power managers and flags related was a suspect and seemed very likely as a cause.

I don't blame power tools/manager/init. Removing power options/tools/flags solved my problem and as I see it the system wouldn't benefit. Having anything related to power saving that turns off computer (on this machine) lead to some previous problems. I did experiment with it, but nvidia driver seems to have trouble restoring state after power off. So reason why I disabled power managers was mostly the driver and possibly the problems originate in the hardware too. Nice hardware .. bad hardware :)

Hope I didn't shoot myself in the foot this time. (I did, but I corrected the mistakes I think). I might correct what I said in this message if I haven't made too many mistakes (again) :) Anyway hope this post satisfies both eccerrOr and Hu. Thanks to eccerrOr for his comments which would have lead me to solution. Thanks to Hu for clearifing my mistakes (Did confuse me a bit, but it still cleared up some things).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum