How to Autorun a program in Linux(Centos)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to Autorun a program in Linux(Centos)
# 8  
Old 08-18-2012
Sorry, but there is a difference between helping someone do his work and doing his work for him. You have clearly crossed this line.

This thread is closed until you show at least some modicum of effort to do your work yourself.

Moderator's Comments:
Mod Comment Thread closed


bakunin
# 9  
Old 08-19-2012
After getting the following message from crazydude80 reopened "on probation".

bakunin

Quote:
im working on the code but stuck at some parts.
not sure how to continue from here. pls revert back my thread. thanks
--------------------------------------------------------------

Code:
#!/bin/sh
# Copy at startup and remove at shutdown
#

start() {
/mfgdata/pcount/program

}

stop() {


}
case “$1″ in
start)
start
;;
stop)
stop
;;

*)
echo $”Usage: $0 {start|stop}”
RETVAL=1
esac
exit 0

# 10  
Old 08-19-2012
Quote:
Originally Posted by bakunin
After getting the following message from crazydude80 reopened "on probation".

bakunin
Guys.. Any suggestion how I can add below commands to the script ? Thanks

Code:
db2start <enter>
Java FileFind & <enter>


Last edited by zaxxon; 08-23-2012 at 03:33 AM.. Reason: code tags
# 11  
Old 08-22-2012
Quote:
Originally Posted by cyberworldukltd
The system usually will have a link in /etc/rcX.d to /etc/init.d/file these are the normal ways of starting something
Yes. I received some info from experts but I'm stuck at here.
I just need to complete the script b4 I could get into /etc/init.d.
Or can I just input db2start <enter > and java FileFind & <enter> directly at /etc/init.d ? Thanks
# 12  
Old 08-22-2012
The reason why you are met with a stony silence instead of helpful answers is because of the way you presented your problem as well as the way you presented yourself here.

Instead of asking advice you could have:
  • had a look at other, similar init-scripts. You might have noticed some pattern there

  • learned something about scripting in general. Your question amounts to "can i put a command into a script the same way i enter it on the command line and have it executed" - this is exactly the kind of question which is answered on page 1 of every book or article about scripting for beginners. While you are not expected to understand every detail about script programming you are expected to at least read this first page.

  • simply tried. Computers (and their programs) are not bombs and doing something wrong will not make them explode in your face. Since you, lacking any of the necessary knowledge, are tasked with installing it, the system is perhaps not in production, so even in the (unlikely) case of something fatal happening you sure could restore another test system and learn from your tries.

And for failing to follow any of these possible courses of action most people here ignore you and your threads. I suggest you think about your attitude before you even try to solve your problem. The only thing between you and a solution is this very attitude - not the problem, not even your lack of the necessary knowledge, but your constant refusal to actively pursue the knowledge instead of waiting to get it spoon-fed.

I hope this helps.

bakunin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Cybersecurity

Is there an Automated script for CIS CentOS Linux 7 Benchmark please?

Hi, Apologies if this is not right section to post my requirement. We have a requirement to enhance our Centos 7 Servers' security as per "CIS CentOS Linux 7 Benchmark" ( CIS WorkBench / Home ) that provides guidance for establishing a secure configuration posture for CentOS 7. Just... (2 Replies)
Discussion started by: prvnrk
2 Replies

2. Shell Programming and Scripting

Good way to check firewall port on Linux centos 7

Hi, I need to know what kind of firewall settings does the linux box have? Is port 25 blocked in any way? Linux techx 3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux I'm coming from this thread. (1 Reply)
Discussion started by: mohtashims
1 Replies

3. Red Hat

Run program compiled in Ubuntu in centos

Will a program compiled in ubuntu 14.04 execute in Centos 7? That is to say a tarball or zip is downloaded from github and extracted, compiled, and make is all done in ubuntu 14.04, can I mv the program from ubuntu 14.04 to Centos 7, add it to path in Centos 7. And run it? Thank you :) (3 Replies)
Discussion started by: cmccabe
3 Replies

4. Shell Programming and Scripting

How to schedule a shell script in Linux centos?

Hi All, I have a script that I need to schedule on daily basis. How can I schedule a script in centos. Like I want to run that script evryday at 10 AM and can I store the output of the script in a log file. Thanks ---------- Post updated 04-18-14 at 12:52 AM ---------- Previous update... (0 Replies)
Discussion started by: Palak Sharma
0 Replies

5. Red Hat

Hack a centos Linux box

HI, I have a Centos linux box and there is interface connect to internet. I stop the iptables in this box . After a few day , I find the linux box have been hacked and install some perl script into the box . Could anyone tell me how the hacker can login into the centos box without knowing... (1 Reply)
Discussion started by: chuikingman
1 Replies

6. IP Networking

Linux centos, can't connect whois.tucows.com

Hello, when i tried to get whois on an .com domain, it automatically used tucows whois, it appears it cant connect that server, please how can i fix it, so it dont fail or use another server? whois mydomainname.com -f + whoisout=' ' I have: Linux * 2.6.18-348.3.1.el5.028stab106.2 #1... (5 Replies)
Discussion started by: postcd
5 Replies

7. Emergency UNIX and Linux Support

Websockets proxy on CentOS Linux?

I need to setup a proxy that will sit in front of a websockets server and proxy websockets communication both to and from the server. There will only be one specific client trying to access this server using the websockets protocol. We can configure the proxy settings for port and IP on the... (3 Replies)
Discussion started by: glev2005
3 Replies

8. Red Hat

Authentication Failed in Linux centos

Hi everyone ... ( Linux Cent OS ) i cant login as root user in my lab machine ... i did give correct root and root passwd ..but it showing Authentication Failed ... plz help me (0 Replies)
Discussion started by: coolboys
0 Replies

9. Linux

sort command in centos linux os

Iam working on centos os. Iam not able to sort records without option Please help me out Jayaprakash B. (1 Reply)
Discussion started by: jpachar
1 Replies

10. What is on Your Mind?

Linux Centos 5.4 BTMP file size

Dear fellows, I have Centos 5.4 linux with DNS server, all logs are normal, in my /var/log/ btmp files is getting larger day by day. What is this btmp file for? How can i reduce the file siez or control file size. Waiting. MAZ (1 Reply)
Discussion started by: maz
1 Replies
Login or Register to Ask a Question