General :: Execute A Shell Script On Startup?
Mar 31, 2010
I have create a script to start a server(my first question). Now I want it to run on the system boot and start the defined server. What should I do to get this done? My findings tell me put this file in /etc/init.d location and it will execute when the system will boot. But I am not able to understand how the first argument on the startup will be start? Is this predefined somewhere to use start as $1? If I want to have a case startall that will start all the servers in the script, then what are the options I can manage.
My Script is like this:
#!/bin/bash
case "$1" in
start)
start
[code]....
View 2 Replies
ADVERTISEMENT
Mar 12, 2011
ill have this question on the test maybe : In dir00 directory create files year01.txt, year02, ...year05.txt with January calendar for 2001-2005 years in it.-i'm lost. i execute this : cat | cal 01 2001 > year01.txt
View 12 Replies
View Related
Aug 31, 2010
i want to run a jar file at the start up..and only that application will work at the start up..other all are blocked..after giving input to the application the xwindow will enabled..otherwise it remains same.
View 1 Replies
View Related
Nov 9, 2010
I am using following code to read a lien from a file and store the value to a variable $line and execute it.
while read line
do
./$line &
[code]...
View 6 Replies
View Related
Aug 4, 2010
I am running Linux Mint 9..I play xbox live and run it through my laptops wireless network connection so i dont have to pay 100 dollars for the usb wireless adapter for the xbox. In windows 7 this is easy to configure so that when i turn my laptop on and then xbox it automatically connects.
View 10 Replies
View Related
Feb 25, 2010
I've looked everywhere but I can't find where to change the default box for incoming mail, or am I on the wrong track. It's a nuisance having to change folders and I can't configure wastebin to empty on exit.And I can't get kmail to import from evolution. Do I have to go to the evolution storage and do it manually, and if so, how do I do that?
View 1 Replies
View Related
Jan 11, 2011
Ubuntu version 10.10File location inside a folder on DesktopFile extn : .shI need to run this file in terminal console, but what path to be given is the question.
View 5 Replies
View Related
May 19, 2011
Before I re-installed ubuntu I could just double click a shell script and I got prompted to chose if I wanted to edit it or run it. Now it just opens it in gedit.How do I execute it using the GUI not the command?
View 4 Replies
View Related
Jan 10, 2010
The two host one is Aix 5.3 and another is Suse 10sp2 the both have the same script which including the following parts:
if [ `date +%a` = "Mon" ];then
if [ "$RESULT" = "" ]; then
echo "The `hostname` $DATE ok"
[code]...
View 1 Replies
View Related
Aug 11, 2011
how to execute commands on startup. I've added lines to /etc/rc.d/rc.local, /etc/rc.local, I've put scripts (with extension .sh) into /etc/init.d/ and I've set the executable permission thing on all of them with chmod -x. I *still* can't get anything at all to execute on startup. The truth is, I'm trying to enable multitouch and button tapping automatically when I startup Fedora. I have the commands
[code]...
Which I want to execute whenever I start Fedora (it's a bit tedious to write them every time, or even to have to execute a script myself whenever I start my computer). Furthermore, if I can figure this out, then I can do all sorts of things. Does anyone have a clear, surefire way in which I can do this? I'm not good with using Linux at all
View 7 Replies
View Related
Feb 20, 2009
Users will write data on a samba shared folder at any give time. I need to execute a script as soon as some thing is written to that shared folder. What I need to know how to execute a script as soon as something some data is written to that shared folder.
View 1 Replies
View Related
May 29, 2011
i want to know whether we can write a shell script which can utilize 2 CPU's of a cluster...I heard its possible through C Shell [URL] But im familiar with bourne shell only....So is there a possibility to write Parallel Scripts.
View 5 Replies
View Related
Apr 19, 2011
hint me why and how to execute the below for loop, the way i am trying to?
[bkcreddy17@local:~]$ cat -n test
1 date
2 ls -l
[code]...
View 14 Replies
View Related
Apr 7, 2010
I am trying to execute a 4GE file using command something like this "/usr/bin/ksh path of the file with some arguments " ex: /usr/bin/ksh /home/abc.4ge S "./xyz" . I am able to execute the 4GE without this "/usr/bin/ksh" specifying in the command which basically runs in ksh shell itself. But when i try to run it exclusively using the path of the shell it gives me an error something like this "/usr/bin/ksh: /home/abc.4ge: cannot execute". I did check the permissions and all the file has execute permission.
View 7 Replies
View Related
Mar 13, 2011
Skype works for me, but there is a small thing i like to solve.
For the x64 version i need to start skype with a bash command so that the video and sound works and i thougth that a simple batch in folder bin would solve it.
So that it gets executed automatically once the desktop loads. Seems it doesn't since i still have to do it manually.
How do i execute a batch automatically upon startup under KDE?
View 1 Replies
View Related
Jul 9, 2010
i'm trying to automate terminal commands to execute at startup (rc5)one is a background process: Code: xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Two-Finger Scrolling" 8 1 the other is a gui application: Code: /home/labr/apps/gmail-notify/notifier.py i placed these commands in /etc/rc.local but does nothing.
View 2 Replies
View Related
May 4, 2010
how can I execute pppoe-start on Slackware during startup or reboot? What is the proper way? Should I add a script on rc.d directory?
View 2 Replies
View Related
Mar 17, 2009
I do not want to use cron.I want it to be instantaneous. I am working on a web server where the hosts turned-on safe mode and turned off a-lot of the functions for PHP (including exec) in order to secure their servers. Outside of that, I do have access to chroot and can pretty much do anything on the server. I want to use ImageMagick to create dynamic images based on form data.
I was trying to find a work-around with PHP where I can still use ImageMagick (a shell-based imagining program) by causing SQL to execute a shell script after the form data is saved to a table. Is there anyway it could cause a flag to automatically run a shell script when someone adds a new row to a certain table. It has to be instantaneous, more or less, so that the user isn't sitting there waiting for a minute for cron to catch any changes to the database.
View 1 Replies
View Related
Nov 19, 2010
This is weird. I have a shell script with no execute rights.$ chmod -x test.shThen I try$ test.shwhich does not work. (I have "." in PATH)When I do$ . test.shit works! I can run the script even though I have no execute rights. Why is that?Another question: If I have a shell script without a hash bang, I still can execute the shell script. Why? What does hash bang do? If there is no hash bang, why is the shell script run? What does the hash bang do
View 9 Replies
View Related
Jul 19, 2010
I am writing shell script for executing oracle procedure. Shell script need to take 3 parameters from one data file rest of the parameters need to pass in command line it self. Total 7 parameters are need to pass for shell script.1st,3rd,5th parameters need to take from dat file and rest of 4 parameters from command line.
Below is one oracle procedure:
EXEC CIM_MGMT_INSTALL.addFlow('$1','1.0','$1','Settings','$2','ECCD2',NULL,1);
$1is 1st and 3rd both places need to pass same parameter.$1,$2 need to take from data file as earlier says.
View 2 Replies
View Related
Sep 3, 2010
as root user during boot sequence (last boot sequence script file). how I can do that?
View 4 Replies
View Related
Mar 11, 2010
I wish to execute a shell script once a button on my html page is clicked.
View 7 Replies
View Related
Jun 26, 2010
php. I am developing a web-interface for an application that sometimes needs root privs. Editting /etc/sudoers is not an option since the web interface needs to be portable to other users when they install my application. Is there any workaround ?PHP Code:
php code:$command = "./script.sh /dev/$DISKNAME &";$shellOutput = shell_exec($command);
Code:
[code]...
View 2 Replies
View Related
Apr 15, 2010
I am trying to run a script which would execute once the system start's up. I placed my script in /etc/init.d and made it chmod +x my-script and placed my script path in /etc/rc.local . It works fine in installed environment and its not working in live cd and USB.
View 9 Replies
View Related
Jul 29, 2009
In bash shell how to run shell script during startup
View 2 Replies
View Related
Nov 20, 2010
I need to run a shell to enable pseudo-multitouch on my touchpad using a shell which automatically configs synclient.I put this file under /home/<username>/, and also put this to the Session manager under system menu. But it doesn't work. I've already used chmod command to make sure that the file is executable.
View 9 Replies
View Related
Apr 18, 2010
I'm looking to make a launching script which launches a program in one of the current directories that the user has open, the problem is I have no idea how to get info about all of the terminals open.I simply want to check which directories the user has open and do a pwd on the terminals, and then use that to cd into the dir before launching. I might be able to use a combo of who,tty, top, and pwd...but I don't know where to go.
View 7 Replies
View Related
May 6, 2011
I wrote a script, and what to make it surring with ububtu as startup shell.
View 9 Replies
View Related
Apr 28, 2011
I use CentOS 5.5 and I've trouble in run shell script after system reboot. That script runs jboss server and it looks that way:
#!/bin/sh
rm -R -f /opt/billing/jboss-6.0.0.M1/server/default/tmp/
rm -R -f /opt/billing/jboss-6.0.0.M1/server/default/work/
/opt/billing/jboss-6.0.0.M1/bin/run.sh -c default -b 0.0.0.0 -C /opt/billing/jboss-6.0.0.M1/server/default/lib/ > /dev/null &
I've created user account for jboss.
privileges of above script are okay. I've tried so far:
- add command to /etc/rc.local
- add script to /etc/rc3.d/ and create symbolic link to it in /etc/init.d/
- add run script by @reboot annotation in crontab (crond automatically starts with OS)
and jboss still sleeps after reboot. I've noticed that commands which remove directories seem to work when I've added them explictly to /etc/rc.local. But next command which runs jboss hasn't been executed.
View 4 Replies
View Related
May 27, 2011
Whats wrong with this line?Code:sudo -u user /usr/bin/nohup sh /home/user/somescript.sh &This should ask for the password then execute the script at background and get back to menu
View 8 Replies
View Related