General :: Start Script Bash When System Start Stop Reeboot?
Dec 10, 2009I have 3 script BASH. I want start this script when the system start,stop and reeboot.
View 4 RepliesI have 3 script BASH. I want start this script when the system start,stop and reeboot.
View 4 RepliesAfter install debian 8, I can't see system start and stop message from console ... How can I enable system message from console in debain 8?
debian 7 output
----------------------------------------------
root@demo:~# service apache2 restart
[ ok ] Restarting web server: apache2 ... waiting .
root@demo:~#
debian 8 output
-----------------------------------------------
root@demo:~# service apache2 restart
root@demo:~# <=============================== No message (start or stop)
I have installed Oracle 11g on 5.3. Now, I am trying to START and STOP oracle automatically on system startup and shutdown. I am following this link To have this effect, I have created /etc/init.d/dbora
Code:
#!/bin/sh
# chkconfig: 345 99 10
ORA_HOME=/oracle/app/oracle/product/11.1.0/db_1
[code]....
I am trying to give access to ONE single user to start and shutdown tomcat server. The problem being, when I enter syntax: username ALL= /etc/init.d/tomcat5, /usr/local/tomcat/webapps, PASSWD:ALL This gives the user access to start and stop tomcat but also gives user access to start and stop other services within /etc/init.d - such as httpd etc... What is the proper way to give user access to start and stop service, and limiting that power to only one service....
View 2 Replies View Relatedia have this script
#!/bin/bash
if [ -e /tmp/mysql.pipe ]; then
[code]...
I use a centos VPS with 1gb memory and enough space and brandwidth (if this info is off any use). What I want to achieve is that I can start and quit a process that is running in a screen, with using a script.
Like start.sh that does "screen serverapp1"
and stop.sh that does "kill serverapp1"
I already tried something like that, but it didn't work. The kill command only works with process ID's and that one is variable.
Sometimes I use vnc server and start desktop. The memory use rises about 2gb during this. I need to be able to turn off the xwindows after I shutdown vnc without rebooting. Is there a way to do this?. And I don't need to know how to disable at boot thats not what I need to do.
View 5 Replies View RelatedWhat I want to achieve is that I can start and quit a process that is running in a screen, with using a script.
Like start.sh that does "screen serverapp1 ./serverapp1"
and stop.sh that does "kill serverapp1"
I already tried something like that, but it didnt work. The kill command only works with process ID's and that one is variable.
EDIT:
What I've tried (because google is my friend):
[servercod4001@datacenter-196 ~]$ screen -ls
There is a screen on:
11343.servercod4001 (Detached)
1 Socket in /var/run/screen/S-servercod4001.
[Code]....
I am using RHEL 5.0. I am having problem with postgresql service it is not starting, not stopping, not restarting.
View 5 Replies View RelatedI configure my apache and can run http://localhost. There "I see it works!" but if I try to stop apache I get message that httpd is not started. I run
apachectl start - ok
but when I run apachectl stop it says "httpd (no pid file) not running"
I need to stop apache, because this is my dev machine and I want to start apache only when I make changes to my site. I am with slackware13.
i've made a big update of almost 300Mb.I'had a working DNS server.Now, when i boot the box, named works and it resolves all the clients.If i make any change (enter a new client for example) and of course i restart named (service named restart), named stop but does not start again !!!In order to get a working named, i 'm obliged to reboot the box?
View 6 Replies View RelatedI want to start recording when someone starts talking, and stop recording when it becomes silent. I guess if there is stream audio processing tool like ImageMagick, so I can strip away blank sections like this:
$ rec -t wav - | wavefilter -strip-blank=3sec | lame - >record1.mp3
EDIT This question is resolved by using:
$ rec -t wav - silence 1 0.1 3% -1 1.0 3% | lame - >record1.mp3
I know I have to count how many instances are running: ps x | grep apache2 | wc -l result if it's running: 2, or else: 1 I also know there is a command called test that I could use to perform the verification, but I don't know how to use test with wc
View 3 Replies View RelatedI'm trying to execute some code (let's call it login.java) when I log in and out of my linux machine. Is there any way to do this? I'm looking for perhaps a way to trigger the code? I've thought of just putting it in my .bash_login but preferably the code would launch on normal login, not when I start my terminal.
View 2 Replies View RelatedI am using Fedora and trying to auto run a script soon after the unit boots to desktop. I found many suggestions and finally decided to use the Sessions->Startup Programs option (under System->Preferences->Personal->Sessions menu). I added my script in the Startup Programs with the command 'sh myscript.sh'. Now I have two questions here:1. When I use the command 'gnome-terminal -e myscript.sh', I get 'There was an error creating the child process for this terminal' message after logging into the desktop. Can any one tell if I am missing something here?2. Even if I use sh instead of gnome-terminal, I still want to see the script executing. In other words, my script has certain echo statements indicating the flow of the script. But I don't see any shell opening up with these echo statements showing up, after the unit boots to desktop. But the script was still executed with no problem
View 1 Replies View RelatedI am using Sphinx search on my webserver and it quits after a certain amount of time leaving my search page broken.Here is a bash script that I want to run every 10mins via cron:
Code:
#!/bin/bash
if pgrep searchd | grep "[0-9]"
[code]...
I've been switched to a new department at work and am totally clueless when it comes to scripting in bash. When I told them I was a fast learner, I didn't think they'd throw me into the deep end of the pool so fast. So to make a long story short. What is a great book to start learning scripting in bash? My supervisor already gave me a simple task to do. Conceptually it sounds quite easy in my head, but actually writing out a script is a bit more daunting and complexed than I first thought.
View 3 Replies View RelatedI install lirc and want to prgram irxevent start automatic when the system start
Code:
System->Preferences->Startup Applications
Add an item,but that not works every time,means sometimes cannot work.
I am using Rhel5 and I'm new to linux so pardon me for sounding a bit green around the ears.Anyway..I got an error message a few weeks ago about how the start up script that displays icons on the far right of my start panel was malfunctioning and it was going to be deleted from the start-up. didn't really know what it really meant and I just clicked ok.wireless eth0 status icon as well as my amarok status icon are hidden on the start panel. How do I get it back/add that script back to the start-up
View 6 Replies View RelatedI have an Ubuntu server in which a file is dumped every hour and a new file for the next hour and the process continues. If there is any problem due to which the creation of file stops then empty files are created every minute till the process is killed & started again. I need help to make a shell script to check if the empty files are being created and then kill the process and start it again.It would be a great help if anyone can help me regarding this.
View 9 Replies View RelatedI'm trying to start/stop Informix along with my linux os start/stop. For this I've made a test script in order to test this but I'm facing a problem. The service is starting along with the system but when I'm stopping (rebooting) the system it doesn't run the "K10test" script.
After sistem reboot you can see that the /etc/init.d/test stop is not executed.
I use Opensuse 11 with fvwm. How can I get conky start automatically when I start fvwm?
I setup the conky under fvwm session for my Opensuse 11 but it won't start automatically. I am wondering how to write some kind of scripts to force it to start automatically and with a delay about 10 seconds after fvwm starts.
I set Kmail to launch on start up but now no longer wish for it to do so. However, i cannot find the setting i changed in the first place.
View 4 Replies View RelatedWhen copying files to USB drives, the file progress bar moves it 'bursts', sometimes doing nothing for long periods, then moving forward quickly and stopping again.It's almost like it is showing the transfer to the cache, not the transfer to the actual drive.
View 5 Replies View RelatedHost - ubuntu 9.10 64bit
Virtualizer - KVM
I need to stop KVM starting at boot. I added following 2 lines at the bottom of /etc/modprobe.d/blacklist.conf
Code: blacklist kvm
blacklist kvm-amd Reboot PC
It doesn't work.
$ lsmod | grep kvm Code: kvm_amd 41556 0
kvm 190648 1 kvm_amd
What further command I have to run in order to activate the new blacklist.conf ?
I'm looking for some pointers on a method to "transfer" the song-playing from my laptop to my PC, both running ubuntu. The use case is: I'm home listening to some song on the laptop. Then I realize how crappy the speakers are. Here's what I do *now*:
1. Stop playback on the laptop
2. Get up, go to the PC, open the music player
3. Find the same song
4. Try to find the same point in the song
5. Stop playback on the laptop
6. Start playback on the PC (the PC has good speakers)
Of course now I'm dreaming of having a "button" I push that does all this all by itself. Can anyone give me some pointers?
I'm running Debian 8.4 on a Lenovo W500 laptop and I recently upgraded from kernel version 3.2.0-4 to 3.16.0-4. Since then I encounter issues with lightdm (I suppose) which manifest themselves in two different scenarios:
1) scenario 1: lightdm fails to start.Instead of showing the graphical login screen, the system boots into terminal. Lightdm seems to be running, but I can't enter the X-Session (Alt+Ctrl+F7 doesn't work), nor can I restart the lightdm via
Code: Select all# service lightdm stop
# service lightdm start
dmesg shows the following (I've only pasted the end of dmesg):
Code: Select all[ 240.100071] INFO: task kworker/0:2:39 blocked for more than 120 seconds.
[ 240.106512] Not tainted 3.16.0-4-amd64 #1
[ 240.112956] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 240.119494] kworker/0:2 D ffff880155155a48 0 39 2 0x00000000
[code].....
and /var/log/lightdm/lightdm.log shows errors of type
Code: Select allGtk-CRITICAL: gtk_container_foreach: assertion 'GTK_IS_CONTAINER (container)' failed
when I then try to shutdown via
Code: Select all# shutdown -h now
the OS gets stuck on a message of the form
Code: Select allirq 17: nobody cared
and eventually I have to force a shutdown by holding the poweroff button.scenario 2: lightdm starts, but can't be stopped/In this case I can login and use the system as usual, but when I try to shutdown either via # shutdown -h now, or via the GUI or the power button, the system gets stuck and I have to force a shutdown by holding the poweroff button.It seems that people had similar issues on other distros (see e.g.: URL... but there doesn't seem to be a good fix so far. I can for now solve the issue by downgrading the kernel to 3.2.0-4, but I was wondering if there is a permanent fix.
I am trying to make a web server with debian 6 and i want a xfce dsektop when i need to open files,extract,navigate but to be able to turn it off when i dont need it (to save ressources).I already installed it with aptitude install xorg and aptitude install xfce.
View 4 Replies View RelatedFedora 12 64bit KVM
How to stop KVM start at booting?
Then how to start it after booting?
i am using putty to connect to my server and wanted to restart mysql server. searched the internet and found thatcommand is /etc/init.d/mysqld start or stopbut it did not worked.then tried /etc/init.d/mysql stop or startthis also did not worked.
View 6 Replies View Related