WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: commands in .X.d not working  (Read 2473 times)

Offline nurbles

  • Newbie
  • *
  • Posts: 46
commands in .X.d not working
« on: March 06, 2020, 11:43:35 AM »
I am moving some stuff that worked great with TinyCore 3 & 5 to TC 11.0.  The command I have in a file in my .X.d folder is not working like it did in the older versions of TC.  In the 11.0 system, I am getting an empty terminal window that echos every key I type.  In the older systems, I saw my program running in the terminal window.

If I execute the command by hand, it works as expected, so I know my command line is correct:
Code: [Select]
aterm -e ash -l -c /home/tc/checknet.shThe checknet script is mine and runs my executable after cleaning up the working folder.

Interestingly, using htop I can see that my program is actually "running" but for some reason it doesn't appear to actually be "working" and does not generate any expected output (or any output at all) to the terminal where it should be running.  But if I kill my program, the terminate goes away, as expected when my program terminates.  So it is kinda running, but not working.

But remember, if I type the EXACT SAME COMMAND by hand, my program works perfectly.  The code was even rebuilt on a CorePlus 11.0 machine so that it would be completely compatible.

I don't know where else to search for info.  I cannot find any examples of .X.d commands or any clear description of exactly what is and is not allowed in the command lists that .xsession will execute from .X.d.  If examples and/or documentation exists, please help me find it and I will try to solve my own problem.

    [EDIT]: Changed quote tags to code tags.  Rich
« Last Edit: March 06, 2020, 12:06:57 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: commands in .X.d not working
« Reply #1 on: March 06, 2020, 12:02:46 PM »
Hi nurbles
... If I execute the command by hand, it works as expected, so I know my command line is correct:
Quote
aterm -e ash -l -c /home/tc/checknet.sh
The checknet script is mine and runs my executable after cleaning up the working folder. ...

 ... But remember, if I type the EXACT SAME COMMAND by hand, my program works perfectly.  ...
If it really is  "the EXACT SAME COMMAND"  then it should look like this:
Code: [Select]
aterm -e ash -l -c /home/tc/checknet.sh &

Offline nurbles

  • Newbie
  • *
  • Posts: 46
Re: commands in .X.d not working
« Reply #2 on: March 06, 2020, 02:19:11 PM »
The command works the way I want as I wrote it in my post.

I managed to solve this myself by discovering that part of my network configuration wasn't being saved -- the network settings tool never saves ANY changes that I make.  Ever.  So I made them myself and ensured that the boollocal script enforced them.

After that, my start up program worked like a charm.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: commands in .X.d not working
« Reply #3 on: March 06, 2020, 03:18:47 PM »
Hi nurbles
Commands launched via the  .X.d  directory should be terminated with an ampersand so that they are backgrounded and don't
block any commands that may follow from running.

... I managed to solve this myself by discovering that part of my network configuration wasn't being saved -- the network settings tool never saves ANY changes that I make.  ...
That's correct. The network tool saves the settings in a configuration script in  /opt  typically called  eth0.sh.  You then call that
configuration script from  bootlocal.sh.  It is up to the user to either add the file to their backup or to switch to a persistent  /opt
directory. The  Control Panel  has a  Backup/Restore  button for managing which  files/directories  to include in your backup.

I would like to suggest that you take an hour to read this fine book:
http://tinycorelinux.net/corebook.pdf
It will provide some insight in how Tinycore is different from other Linux distros.