#!/bin/bash while [ true ] do echo "quering bearerbox" sleep 1 count=$(ps -C "bearerbox" | wc -l) echo $count if [ $count -eq 2 ] then echo "attempting to kill bearerbox" killall bearerbox else sleep 1 echo "======= bearerbox killed ========" break fi done sleep 1 bearerbox /etc/kannel/kannel.conf smsfox /etc/kannel/kannel.conf
Internet is vague. It has nothing left to be covered now. However, things get messed up sometimes and I forgot where I used to find the materials I had just searched for some days ago. So, I am now gathering all those into this blog. This is just my bookmark or my scrapbook or anything you wish to say. If you think these are helpful, you can take references, no any rights to be defined here. No styles and no colorful designs, just an area to jot down some scraps and all. Enjoy
Pages
Showing posts with label administration. Show all posts
Showing posts with label administration. Show all posts
Wednesday, June 23, 2010
Kannel restart script | Attempting to Kill a process in linux until it gets killed
Restarting kannel wasn't simpler, as the bearerbox was not exiting on single stop command for Kannel. So needed to do some tricks on killing the bearerbox first. See the code
Labels:
administration,
bash shell,
Command Help,
fork,
HowTO,
kannel,
Linux,
process,
process management,
Programming
Altering system default timezone in linux
Reference:
http://www.cyberciti.biz/faq/howto-linux-unix-change-setup-timezone-tz-variable/
OR type setup and select time zone configuration (good for remote ssh text based Linux server sessiob)
Select timezone configuration
Now, just follow on screen instructions to change timezone.
Create a symlink to file localtime:
OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
OR if you want to set up it to IST (Asia/Calcutta):
Please mote that in above example you need to use directory structure i.e. if you want to set the timezone to Calcutta (India) which is located in the Asia directory you will then have to setup using as above.
Use date command to verify that your timezone is changed:
Output:
Sample Output:
http://www.cyberciti.biz/faq/howto-linux-unix-change-setup-timezone-tz-variable/
Change Linux timezone
Select the method as per your Linux distribution:If you are using Fedora / RHEL / Cent OS Linux
Type the redhat-config-date command at the command line to start the time and date properties tool.# redhat-config-dateOR type setup and select time zone configuration (good for remote ssh text based Linux server sessiob)
# setupSelect timezone configuration
Now, just follow on screen instructions to change timezone.
Set timezone using /etc/localtime configuration file [any Linux distro]
Often /etc/localtime is a symlink to the file localtime or to the correct time zone file in the system time zone directory.Generic procedure to change timezone
Change directory to /etc# cd /etcCreate a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/EST localtimeOR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/EST localtimeOR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtimePlease mote that in above example you need to use directory structure i.e. if you want to set the timezone to Calcutta (India) which is located in the Asia directory you will then have to setup using as above.
Use date command to verify that your timezone is changed:
$ dateOutput:
Tue Aug 27 14:46:08 EST 2006
Use of environment variable
You can use TZ environment variable to display date and time according to your timezone:$ export TZ=America/Los_Angeles
$ date
Sample Output:
Thu Aug 27 11:10:08 PST 2006
Labels:
administration,
Command Help,
configuration,
cyberciti.biz,
date,
FAQ,
HowTO,
Internet,
Linux,
timezone,
Tips and Tricks
Subscribe to:
Posts (Atom)