WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: sometimes my script in ~/X.d/ does not get run  (Read 4313 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
sometimes my script in ~/X.d/ does not get run
« on: September 13, 2019, 12:40:37 PM »
I have a single script in ~/X.d/ called "startup-applications" that runs some miscellaneous stuff I need. Sometimes after booting I notice that none of the jobs in that script got done, causing me to have to reboot.

Because it only happens about 1 out of every 10 boots, I'm guessing it's an unusual race condition that only happens sometimes. Anything I can do to make sure the script is successfully launched at every boot? Maybe I just need to put a sleep 1 somewhere?

Thanks for any tips.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: sometimes my script in ~/X.d/ does not get run
« Reply #1 on: September 13, 2019, 12:55:59 PM »
P.S. My ~/.X.d/ directory is not persistent: It is restored from mydata.tgz at boot (i.e., it is one of the directories in my /opt/.filetool.lst)

It seems that whatever runs the scripts in ~/.X.d/ sometimes tries to do so before mydata.tgz has been completely restored.



Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: sometimes my script in ~/X.d/ does not get run
« Reply #2 on: September 13, 2019, 01:44:41 PM »
Hi, GNUser!
As i can understand, you have removed your $HOME from .filetool.lst, and use separate entries for your $HOME/* files and directories. Does only .X.d disappear, or other files and directories play the same game?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: sometimes my script in ~/X.d/ does not get run
« Reply #3 on: September 13, 2019, 02:00:09 PM »
Hi, jazzbiker. Thanks for the input. Correct, $HOME is not in .filetool.lst, just selected subdirectories of $HOME. 

Actually, I've refined my understanding of the problem: ~/.X.d/startup-scripts is there, and most of the jobs it lists get run. The one that tends to fail is xbindkeys & which is important to me because it enables all of my keyboard shortcuts.

I'm going to assume that xbindkeys sometimes butts heads with something else at boot. Will adding sleep 1 before it and see if it helps.