Red Hat :: Run Shell Script During Startup?
Jul 29, 2009In bash shell how to run shell script during startup
View 2 RepliesIn bash shell how to run shell script during startup
View 2 RepliesI 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 RelatedI 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]....
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 RelatedI wrote a script, and what to make it surring with ububtu as startup shell.
View 9 Replies View RelatedI 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.
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 Relatedusing any sort of rxvt-based terminal with TERM set to rxvt (or rxvt-unicode) then ^L will not clear the screen, only act as newline. This is not the behavior I see on Debian or CentOS. I have the same user environment at each site. Using urxvt on centos, ^L will clear the screen like readline(3) says it should. If I then ssh to slackware, it won't. exporting TERM=xterm will cause the correct behavior after having logged in to slackware, but I'd rather understand why this is happening. I've tried moving aside all the shell startup scripts, setting clear-screen explicitly in .inputrc, setting stty sane nothing doing. Am I missing something?
View 10 Replies View Relatedwhat shell command I should look into that will "mount" a printer that is present in lsusb output, but not present in /dev/usb/? I have a working printer connected with a Parallel to USB printer cable, but after I reboot the machine the printer is not "mounted" (for lack of the correct term?) at /dev/usb/lp0 until I unplug the USB cable and plug it back in lsusb sees it always though.
View 1 Replies View RelatedMACHINE: HP Proliant DL260G5OS: SLES 11 SP1kernel: Linux xserver 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/LinuxIt is used as remote xserver in a LAN.I have configured /usr/lib/restricted/bin/.rbashrc with some environment variables but when the users logon in the system finally is executed $HOME/.bashrc and some environment vars are overwritten.
View 2 Replies View RelatedI want to change my default shell to tcsh. I used
Code:
usermod -s /bin/tcsh username
command as given at url
But if I open a new shell, it is still a bash shell.
How do I make my default shell as tcsh?
I am using ubuntu10.04-server 64bit AMD with fluxbox. After I ran Matlab in a shell (without GUI) the shell does not display characters anymore, but will execute any command, I just can't see the characters that I'm typing.. I use aterm and xterm, does anybody know why that is, am I missing a package?
View 1 Replies View RelatedIs there any way I can switch my desktop shell from unity to, say, gnome-shell? I can switch using other console shell I like (bash, csh, fish, etc.). Assume that there is a stable alternative desktop shell, I should be able to choose, too.
(For console shell, we goes to /etc/passwd. But for desktop, I can't find the way to config.)
Is there a way to export a variable to parent shell in shell scripting ?
View 3 Replies View RelatedI am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.
Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....
I would like know when it is necessary or advisable to write a shell script instead of shell function ?
View 3 Replies View RelatedIs there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?
Example:
Code:
>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...
I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.
I am wondering if I can open a shell or new terminal thing from within the terminal in a unix/linux enviroment. Particularly a commandline only one where there is no GUI. Is this doable? how do I do it?
View 3 Replies View RelatedI've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.
View 11 Replies View RelatedQuote:
/usr/local/bin/mencoder /root/video1.avi -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=300:acodec=libfaac:abitrate=64 -srate 22050 -oac lavc -vf scale=360:240 -o /root/output_temp_video1.flv
[code]....
I just upgraded to the 10.04 and everything works just fine as before (except for skype but that really doesn't matters as it has already been 3 years I'm using ubuntu and I managed to get it to work only once, for miracle I believe ^^). The only real issue I have is this: when I start up my laptop, after the log-in, no sound will be heared as the "speaker" volume level in alsamixer is set to 0; if I raise it from the terminal running alsamixer (as I don't know any other alternative) everything plays just fine, but the next time I boot I do have to do it all over again... So, how can I change the default startup level of the "speaker" in alsamixer?
PS: by the way I do have the very same issue with the screen luminosity but the other way round as is always starts at maximum brightness and I can't manage to get it to start at the minimum, as it did before. At least reducing the backlight if far more quick but a couple of times I forget it and the battery lasted something like half an hour
I have a situation where I am in a non-interactive shell. I have tried from within my non-interative shell to spawn an interactive shell but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.
Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.
there is a txt file :
["date"]1
["asset"]2
["cash"]3
["finance"]4
[code]....
what i want to get is :
["date"]0
["asset"]1
["cash"]2
["finance"]3
[code]....
how to get it with shell?
I wrote a script a while back that is supposed to be run in bash. It includes a hashpling (#!/bin/bash). Some people who are using the script are having problems with it however because they are forcing it to run in sh. They are doing things like:
Code:
sh script.sh
and
Code:
cat script.sh | sh
which ignores the hashpling and runs the script in sh, making the script fail half way through. How do I make my script determine the shell it's being run in and stop running if it's in /bin/sh?
PS: No, it's not
Code:
echo $SHELL
which has nothing to do with the shell you are currently in. No it's not
Code:
echo $0
which can be used in an interactive shell but does not work the same way in a script. No it's not
Code:
ps -p $$
as this will not work inside of a script the same way as it does in an interactive shell either. Those are the 3 methods that people keep describing when searching for the answer on google, and none of those works for what I need.
i let the update manager do it's thing and update to 10.10.. well. it asked to restart.. and i let it. Now ubuntu will NOT boot up, it shows the purple ubuntu screen with the dots and then a black screen flashes:
Ubuntu 10.10 cody-A0751h ttyl
cody-A0751h login:
3 times then it stays steady. and i log in and it takes me to a command prompt.I try the Ctrl+Alt+F7.. it shows where it TRIED to start up.. but its just stopped. and i tried startx into the command prompt.. and it errors out..
I am writing a script that runs on boot that needs to use scp to get a file. If I run this script after the system boots it works great, scp asks for a password like it should. When this script runs during startup, scp does not ask for a password and so it fails to authenticate. If I use read or mount a LUKS volume at startup the system waits for input like it should. Only scp fails to wait for input.Does anyone know why this is happening and what I can do to stop it? Switching to key-based authentication is not an option.
View 5 Replies View RelatedThe panel plugin from xfce4-mixer has a bug:s icon doesn't update as the volume is changed. This bug has already been reported.One curious thing about it is that, if you right click on the volume icon on the panel, go to 'Settings' (or 'Properties', I don't know, mine is in Portuguese) and then close the window that pops on the screen, the icon is updated.Is it possible to open and close the settings window automatically with a bash script? Like this, I could associate this script with the volume keys of my keyboard, so that the icon is updated as the the volume is changed.
View 2 Replies View RelatedI have a Network Time server provided by my Smoothwall firewall and I can get all the computers on my Lan barring my F11 one, to sync with it.Using SSH I can connect into the F11 PC, what command do I need to run to force it to update?
View 4 Replies View RelatedopenSUSE 11.3 KDE 4.4.4 I am having the same problem as here Basically I can't run shell scripts from the file manager. There is no specialized application for files of the type shell script (application/x-shellscript). The file can be opened in a more generic application as file type plain text document (text/plain), or you can try to install a specialized application for file type shell script (application/x-shellscript). Do you want to try to install a specialized application? As you can see from this command line output, the file is executable.
Code:
myuser@linux-h87v:/media/data/myuser/apps/jetbrains/idea-IU-98.402/bin> ls -l idea.sh
-rwxr-xr-x 1 myuser users 3395 2010-11-19 17:34 idea.sh
I thought that since all shell scripts are showing the same behaviour that openSUSE isn't configuring itself correctly on installation. And strangely, I didn't have this problem last month when I was running openSUSE 11.3 KDE 4.5.2. The file is in my data partition so wasn't wiped out when I reinstalled. I created the same username when I reinstalled so it should still be owned by myuser. I chown'd the file as well just for good measure but I still can't get it to run. This then led me to run the script again but from the command line and I got a permission denied error. I created a new file in my home directory and this was runnable from the command line and from Dolphin but it appears to have the same permission settings I did notice on first login after installation an error about not being able to save bookmarks or something, the rest of the error being: Permission denied. This error message will only be shown once. The cause of the error needs to be fixed as quickly as possible, which is most likely a full hard drive.if it is a strange access permission thing then the error message shown by Dolphin is misleading/incorrect.
If some one can tell me how to get Gnome 3 shell to try it out.I have the 11.4 Suzy gnome edition from Live CD. I tried to find Gnome 3 in the Install/remove software, after reloading it, but it i snot there.
View 3 Replies View Related