WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Microcore auto-start application after boot and keep it running  (Read 1837 times)

Offline skyp

  • WikiUser
  • *
  • Posts: 4
Microcore auto-start application after boot and keep it running
« on: February 07, 2016, 11:33:24 PM »
Hi,

I'm quite new to Linux and shell scripts, so i got some (hopefully easy) problem.
I need to run an interactive proprietary full screen console audio application after the system stands up. ALSA and dependencies are provided through TCE without problem. The executable is located on a cf-card (/mnt/sdc1) wich is mounted at boot time.

I've added the software to the /opt/bootlocal.sh with its full path and all necessary switches. Although its started at the end of the boot, but the cursor keeps blinking in the lower right corner: the program exits and if I hit Enter it gives me back the prompt. :o why?

If I type in manually (the same string I put in bootlocal.sh) it starts normally and stays working until I quit from it. I checked after boot if its maybe running in the background but its says nothing in the background. How can be managed this to work?  :-[
« Last Edit: February 07, 2016, 11:49:52 PM by skyp »

Offline nitram

  • Hero Member
  • *****
  • Posts: 1052
Re: Microcore auto-start application after boot and keep it running
« Reply #1 on: February 08, 2016, 12:39:16 AM »
Believe /opt/bootlocal.sh items run as root fairly early in the boot process. Should the software run as root? If not, remove the bootlocal.sh entry. Instead create a non-executable file in tc/.X.d/ with your executable command(s), reboot and test. For example, create /home/tc/.X.d/startups, 'startups' contains:
Code: [Select]
firefox &
emelfm &


If the partition that contains your executable auto-mounts at boot, then this should work okay. Be sure to provide the full pathway for the executable.

Offline skyp

  • WikiUser
  • *
  • Posts: 4
Re: Microcore auto-start application after boot and keep it running
« Reply #2 on: February 08, 2016, 12:58:12 AM »
Hey nitram thanx for reply!

The executable is a CLI application, its not using X, its character based. There is no graphical window manager on (Micro)Core, so there are no "/home/tc/.X.d/startups", not needed for this. 
BTW it's an embedded system without network connection, and limited keyboard interface, it doesn't matter if its root or not, as long as it has permission to write to the CF card...
« Last Edit: February 08, 2016, 01:22:28 AM by skyp »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9460
Re: Microcore auto-start application after boot and keep it running
« Reply #3 on: February 08, 2016, 01:30:26 AM »
bootlocal.sh is run on /dev/console, which is not a normal terminal like a ncurses app would expect. Please launch your application in either root's or tc's ~/.profile.
The only barriers that can stop you are the ones you create yourself.

Offline skyp

  • WikiUser
  • *
  • Posts: 4
Re: Microcore auto-start application after boot and keep it running
« Reply #4 on: February 08, 2016, 01:41:23 AM »
Thanx curaga!

Could you please help me with an example? As I told, I'm just scratching the surface of shell scriptin'.  :P So what does this mean "in ~/.profile"? Do I need move the executable into one of this folder? 

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9460
Re: Microcore auto-start application after boot and keep it running
« Reply #5 on: February 08, 2016, 02:08:52 AM »
/home/tc/.profile or /root/.profile are scripts, like bootlocal.sh, that are run when that user logs in. Edit one of them like you would edit bootlocal.sh, do a backup.

You may need to add root's into the backup if you choose to run as root, I don't remember if that's included in the default list.
The only barriers that can stop you are the ones you create yourself.

Offline skyp

  • WikiUser
  • *
  • Posts: 4
Re: Microcore auto-start application after boot and keep it running
« Reply #6 on: February 08, 2016, 03:33:11 AM »
Thank You curaga! Problem solved! ;) :D ;D