WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Application auto start  (Read 6906 times)

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Application auto start
« on: August 28, 2012, 02:27:26 PM »
I have my main QT application that I want to have auto start. So I added it to the end of .xsession. All is good, but when I commented out this line and rebooted instead of getting the typical Tiny Core desktop I get the xsetup each time. Even after removing that line that I commented out I still keep getting this xsetup at startup. Maybe something else changed?
my boot codes seem to be ok.

Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: Application auto start
« Reply #1 on: August 28, 2012, 03:05:11 PM »
It could be caused by a number of reasons, from your story must likely the xserver startup cmd in .xsession got lost in the action of editing the file
It should look something like this:
/usr/local/bin/Xvesa -br -screen 1280x1024x24 -shadow -mouse /dev/input/mice,5 -nolisten tcp -I >/dev/null 2>&1 &

have a look at /usr/bin/startx to check out other reasons and to add debugging output.

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: Application auto start
« Reply #2 on: August 28, 2012, 03:11:50 PM »
according to the following
http://wiki.tinycorelinux.net/wiki:the_boot_process
http://distro.ibiblio.org/tinycorelinux/faq.html#appstart
/home/tc/.X.d/*.* is the best place to autostart applications
Code: [Select]
echo "app_name [options]" > /home/tc/.X.d/app_name
« Last Edit: August 28, 2012, 03:19:05 PM by AbNoRMiS »
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: Application auto start
« Reply #3 on: August 28, 2012, 04:11:32 PM »
I dont see in that doc anything saying anything about being best and i dont think its a solution to the problem ;)
Any how good point but I find it more difficult to control in what order things start after X if not writing it straight in .xsession (me being ignorant i mean one could just make a .X.d/.my.xsession).
Besides that its a user file not system one so its gonna be limited in how much clutter there is gonna be and no one else has to see or understand it so in that case i find it ok to sacrefy easy over best practice.
On small one user systems it takes up longer time to maintain serveral files and dirs than a single file but on large multi user systems with several admins I feel its the oposit.
« Last Edit: August 28, 2012, 06:28:38 PM by ananix »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Application auto start
« Reply #4 on: August 28, 2012, 04:28:15 PM »
a start file in X.d is exactly how I've started apps on start of X assuming if you need the apps to run in X   it's not the only way but is the recommended method..

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: Application auto start
« Reply #5 on: August 28, 2012, 04:36:45 PM »
i don't think that tinycore is a small user system because i think it can be expanded to solve any tasks
but in any way for some hidden problems sometimes it's difficult to determine their causes
in order to try to avoid them should follow the principles that laid down by system developers
but unfortunately i can admit that this is not always help
for example here i still can't find a reason why aria2 does not start although it seems that i did everything correctly
« Last Edit: August 28, 2012, 04:41:07 PM by AbNoRMiS »
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: Application auto start
« Reply #6 on: August 28, 2012, 06:11:55 PM »
.xsession is a single user file maintaned by the user itself.

I have not taken into account any OS as any OS can be setup as terminals, pcs, workstations or servers. The extra line about small or single user systems and large or multi user systems was to clarify in general therms oposit the specific example.

In regards to debuging in this case i would say cut the .X.d layer away if anything, but i totaly agree with point of view in regards to follow standards, instructions, principles but this is not out sides those.

do you need a script to start your application, setting up enviroments and so fourth place it in .X.d
or else .xsession is just fine.
.X.d can also be used for what the admin thinks needs to be started with no user control.

Taking all the things in my last two posts into account sometimes it becomes best practice to use .xsession, by the way its there for the user for a reason ;)

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: Application auto start
« Reply #7 on: August 28, 2012, 08:09:58 PM »
regarding usage of xsession i agree
but it is good when know what doing
because in this case any wrong changes
can lead to undesirable consequences :)
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Application auto start
« Reply #8 on: August 29, 2012, 08:29:39 AM »
Well, my .xession file looks ok but I'm starting to think that there could be invalid characters in the file that you don't see.
I explain. I develop on one computer (Ubuntu) and then deploy( or copy) to the target (Tiny Core). Sometime I create an ssh connection via Nautilus and edit text files via gedit.

Could gedit be guilty? I also have just been confirmed that apparently it may have been edited by a colleague of mine via Windows Notepad I think and I think Notepad adds to every line carriage return and line fied (\r\n). Could this be a problem?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14740
Re: Application auto start
« Reply #9 on: August 29, 2012, 08:40:00 AM »
I also have just been confirmed that apparently it may have been edited by a colleague of mine via Windows Notepad I think and I think Notepad adds to every line carriage return and line fied (\r\n). Could this be a problem?

Yes - use "dos2unix filename" to fix

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Application auto start
« Reply #10 on: August 29, 2012, 09:03:05 AM »
Oops I may have been wrong. I had asked someone I work with  to view the file in his hex editor cause he is good at finding abnormal chars in file. So I emailed it to him. He his in Windows using live mail and I think when he extracted the file to disk Windows added the carriage return. I looked at the file in Linux with my hex editor and there is no '\r'.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14740
Re: Application auto start
« Reply #11 on: August 29, 2012, 09:07:12 AM »
To be on the safe side use "dos2unix" on any text file that has passed via windows

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Application auto start
« Reply #12 on: August 29, 2012, 09:13:29 AM »
dos2unix did not work. Does anyone know where or what script could invoke xsetup on boot?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11020
Re: Application auto start
« Reply #13 on: August 29, 2012, 09:19:58 AM »
The shipped file is available in /etc/skel. Maybe compare it to your current file state?
The only barriers that can stop you are the ones you create yourself.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: Application auto start
« Reply #14 on: August 29, 2012, 11:25:38 AM »
I re executed xsetup a few times and nothing changed and I did again and all is well. But the content of my xsession appears to be the same. I've always has 640X480X24. I don't know what is going on. It seems like once in a while when I boot xsetup is invoked.
Does anyone know who is invoking this?