How To Run An Application After The Boot ?

Hi, i know this could seems like a "simple" question but after a lot fo try i can't seems to make it works, i am stuck on this. I am working on a sbc6000x board, linux 2.6.24, an embedded system.

I am working on a pretty nice project which when called like this run perfectly :
Code:
cd /bin
./apps

(/bin/apps don't works, it must be ./apps from the directory)

After searching a little about the startup i learned about rc.local and created it in /etc/init.d, rc.local look like this :

Code:
#!bin/sh
# /etc/rc.d/rc.local: Local system initialization script.
#

cd /bin
./apps
cd

Sadly it seems it is never called. I was thinking about maybe add cd /bin, /.apps to the end of the etc/profile but i don't know if profile can run command aside from simple scripts call.

Does anyone has an idea on why this don't work or on how i could do this ?


Similar Content



Best Way To Run Two Interdependent Scripts

Hi All,

I have two scripts, the aim of these two scripts is, to check whether a particular script is running or not, if it wont runs, then throw a mail.

How i Achieved this output is, I wrote first script.

I created an infinite while loop which performs below steps

1. It creates a touch file
2. Triggers the script which needs to be monitored if its working or not.
3. Removes the touch file.

If the second step fails, then the remove file command will not happen and the script will stuck there itself.

I created an another script which checks the creation time of the touch file and if it is more than ten minutes, it means the second step in the first script is hanged, which also means that particular script is not working.

So if the creation time is more than 2 minutes the second script will throw a mail.

Below are the two scripts.

Code:
#!/bin/ksh



userid="chansd"

filename="/apps/log/check.txt"

while true ;do
touch $filename
pass=`/apps/eDMZ/call_st.ksh $userid`
sleep 20
rm $filename
done

Below script checks the file creation time and throws email if it is older than 2 minutes
Code:
#!/bin/ksh


filename="/apps/log/check.txt"

if [ -f "${filename}" ]
then
if test "`find $filename -mmin +2`"
then
echo "script is not working ! Please act on it" | mail -s "Script  is not working" Example@mail.com
fi


else

        exit 1

fi


What im going to do is

1. I am going to run the first script in background so it runs forever.
2. I am going to run the second script in cron forevry 5 mins to check the file creation time.

3. So if the first script hangs . I will kill the process using process id and after the issue resolves with the inner script, I will run the main script again.

I am new to Linux, Please let me know if this approach will work as expected.

Centos 6.6 /etc/init.d/rc.local Doesn't Run The Command After Restart

Hi

I am using shinx and i have on instructions to execute a command after server restart from rc.local so i do this:

Code:
nano /etc/init.d/rc.local


end i add the command there save and exit:

Code:
/usr/local/bin/searchd --config /sphinxconfig/sphinx.conf

But when i restart is not running and it was fine on Centos 6.5

Then i run it manualy from ssh and all are fine ....

Any ideas why?

Thanks

.o: File Not Recognized: File Format Not Recognized When Compiling

Hello,

I am working on a board (sbc6000x with at91sam9261 micro, linux 2.6.24 to be precise) and having some fun making script i wanted to make real application.
The board is coming with a cross compilation toolchain. When trying to make a simple "hello world" executable to print on the terminal there is no problem.
I open my terminal, give the path of the compiler, cd into the folder where my .c file is and then i type :
Code:
arm-linux-gcc -o hello hello.c

Which create my executable "hello" and this one is working. But like i said, this program only played with the terminal.

The board is starting with a script calling another executable which use the lcd display, i have the source of this executable. My idea was to look at what was in the source of this application (lots of folders and files) in order to understand how it was working. I wanted to test the toolchain on the source (with the makefile) to see if i was able to generate an executable from a application with folderS/fileS but when i try to "make" it i have this error.

In my understanding this is an object file but aside from that i don't see why it would not works.

Thank you for your future answers !

Need Help Running Fsck On Mounted Logical Volume

Hi ALL,
One of filesystem went readonly.Need help how to run filesystem check on mounted logical volume to make the filesystem read write

[root@porsche ~]# cd /opt/apps
[root@porscheapps]# touch 1
touch: cannot touch `1': Read-only file system
[root@porsche apps]#



[root@porsche ]# df -h /opt/apps
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/apps-vg
798G 687G 71G 91% /opt/apps
[root@porsche ]#

Stuck Reboot @ "BusyBox V1.21.1" Then "initramfs" Prompt, Plz Help?!

Hi all! I'm a Linux/Ubuntu noob who has recently bought a brand new HP laptop, nuked the Win 8 OS that it came/w & installed Ubuntu 14.04LTS. After DL/installing apps & setting it up a bit I decided to use gparted & partition my HDD for an additional OS, isolate programs from files, adjust swap, etc. All went well until I was prompted to reboot which I did & now I'm stuck @

" BusyBox v1.21.1 (Ubuntu 1:1.21.0-1ubuntu1) multi-call binary.

usage: chroot NEWROOT [PROG ARGS]

Run PROG with root directory set to NEWROOT "

Which invariably produces: (no matter what command I enter?!?)

" (initramfs) boot from BIOS
/bin/sh: boot: not found "

I'm quite confused @ how to proceed here?

My primary concern is the health of my machine through/after this is worked out.
That said, I'd love to not have to re-install Ubuntu/apps, etc. as I was partitioning the HDD because I had gotten it to a nice back-up place & felt ready to set it up.
Like I said I'm new to Linux/Ubuntu & waayyy behind on my terminal coding, but I could really use some pointers here & I'm not usually hard to teach. lol
Help?! :-[
Thanx!
Embarrassingly yours, WS.

When Looking To Install Software On Xubuntu What Types (xfce Etc.) Will Work?

I just asked a question about Xubuntu and things are a little clearer now. But when I go to install new software or apps is the only thing that will work with Xubuntu something that says it's compatible with xfce?

I don't think that's the case, because I remember installing stuff like the text editor Kate that was more like other things than xfce but it works great anyway.

But what would be really helpful would be if someone could give me a list of the different kinds (I don't even know what they're called but the software programs or apps say things like 'works with KDE or Debian or GTK2 etc.') of things that will work with Xubuntu.

Thanks.

Vncserver On Suse 12 Enterprise

Starting the vncserver by executing vncserver :1 works as expected but what actually starts? I issued these commands but nothing I see identifies with the vncserver. I believe the server is tigervnc.
service --status-all
systemctl -a
systemctl list-unit-files
chkconfig -A
Also, how can this command: "vncserver :1", be issued at startup or turn the service on at startup?
I have tried this but the command does not execute.
-rwxr-xr-x 1 root root 379 Apr 23 17:33 /etc/init.d/after.local
cat /etc/init.d/after.local
#! /bin/sh
#
# Copyright (c) 2010 SuSE LINUX Products GmbH, Germany. All rights reserved.
#
# Author: Werner Fink, 2010
#
# /etc/init.d/after.local
#
# script with local commands to be executed from init after all scripts
# of a runlevel have been executed.
#
# Here you should add things, that should happen directly after
# runlevel has been reached.
#
./usr/bin/vncserver :1

Solved:
Made the following updates to /et/c/init/d/after.local

HOME=/root
export HOME
/usr/bin/vncserver -fg :1

Please Explain How This Read Command Works

Hi All,

I am new to linux and I am finding difficulties in understanding the below commands.

Please explain what is happening in the below commands.

Code:
IFS="~"
exec 4< $BCP_DIR/cnts.data
while read -ru4 TableName Count CreationDateTime Type AccessDate
do
        . /apps/rmb/prod/scripts/load_datasum.ksh
done
IFS=" "
exec 4<&-


Please explain how this commands flows especially
exec 4< $BCP_DIR/cnts.data & exec 4<&-

Why Should I Always Use Chmod When Not As A Root User

System Info:

I have normal user in CentOS 7 whose name is "mostafa" (the name of the account).

I naturally have another user called root with all privileges. User "mostafa" is put into sudoers file, too.

The OS is installed in VmWare, so the system is all mine.

Problem:

Now I create a file with touch file.sh and put a command in it, but when I want to run it with Code:
sudo ./file.sh

, an error is shown that the command Code:
./file.sh

does not exist. But if I Code:
 sudo chmod 777 ./file.sh

then it gets run. My question is that, why should I use Code:
chmod 777

when I myself have created the file, and I am in sudoers.

Can anyone explain me why shuold I still use Code:
sudo chmod 777

when the creator of the file is me.

Cron.daily Symlink (double) Does Not Seem To Be Executing?

Hello,

I cannot understand why the symlink I have put in /etc/cront.daily won't work. It is very possible I am wrong, but my understanding is that cront.{daily,weekly,monthly} works fine with symlinks.

Basically it is double symlink-ed. ls -la on /etc/cron.daily looks like this:

Code:
... 
lrwxrwxrwx  1 root root    49 Nov 27 18:26 rsync_mysql_backups.sh -> /home/myuser/scripts/bash/rsync_mysql_backups.sh
...

Now, ls -la on /home/myuser/scripts looks like this:

Code:
...
lrwxrwxrwx 1 myuser myuser    26 Sep 20  2013 scripts -> /media/md1_storage/scripts
...

I couldn't see anything suspicious in syslog, so I installed postfix in the hope that I will get some sort of information there. Nothing... I also redirected the output of the script to a file in /home/myuser/log.txt but nothing there. The file was not even created.

I am not doing anything mad in the script, I am just synchronising a local directory with a remote one like this:

Code:
/usr/bin/rsync -avzx -e 'ssh -i "/home/myuser/.ssh/myremotehost/id_rsa"' /media/md1_storage/backups/stuff/ myuser@myremotehost:/srv/backups/stuff/ >> /home/myuser/log.txt 2>&1;

As other people suggested in similar threads, I have verified that
Code:
test -x /usr/sbin/anacron

is false, which will result in the execution of the second part of the entry in /etc/crontab:

Code:
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

Any input will be much appreciated. I know I am doing something wrong, but I just cannot see it right now... How can I gather more debugging which will help me understand what's going wrong?

Thanks!