Programming :: Make A Script That Will Check Service/s Status Whether Running Or Stop?

Sep 6, 2010

how to make a script that will check service/s status whether running or stop and also will run stop services?

View 9 Replies


ADVERTISEMENT

General :: Check The Snmpd Is Really Running Apart From Service Snmpd Status?

Feb 8, 2010

I have six linux Centos 5.0 Servers. I had to configure the snmp client. I just created a pretty basic configuration snmpd.conf file

Code: rocommunity CompanyCom 10.1.1.10

I installed all of these

lm_sensors-2.10.7-4.el5.i386.rpm
net-snmp-libs-5.3.2.2-7.el5.i386.rpm
net-snmp-5.3.2.2-7.el5.i386.rpm
net-snmp-utils-5.3.2.2-7.el5.i386.rpm

4 of them are working fine, the application installed on 10.1.1.10 can query 4 servers but I got 2 Linux Centos that are in a DMZ, and my networking team already opened ports and configured NAT but the SNMP Server 10.1.1.10 is not able to query them how can I check the snmpd is really running apart from service snmpd status? might be related with the DMZ configuration?

View 3 Replies View Related

Debian Configuration :: Jessie Service Script Not Calling Status And Stop Routines

Apr 1, 2016

I am the author of an internet radio for the Raspberry PI originally running on Debian Wheezy. The radio (radiod) service is started and stopped using the usual service commands:

service radiod start|stop|status

Since upgrading to Debian Jessie the service status and stop routines in my radio daemon are no longer called.

For example:

# service radiod status
● radiod.service - LSB: Raspberry PI Radio Daemon
Loaded: loaded (/etc/init.d/radiod)
Active: active (running) since Thu 2016-03-31 20:17:07 CEST; 15h ago
Process: 380 ExecStart=/etc/init.d/radiod start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/radiod.service
└─603 python /usr/share/radio/ada_radio.py start

If I call my program (which runs as a daemon) I see the status message from my program

# ./radiod.py status
radiod running pid 603

I have established that service stop never calls my program routines to shutdown the radiod daemon when the system is rebooted (I see that from my log files).

The reboot hangs for about 5 minutes whilst stopping the radiod service (because stop never calls my stop routines).

Below is my radiod script, which is fairly conventional, and which has been working all the time until I ported to Debian Jessie.

/etc/init.d/radiod
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: radiod
# Should-Start:
# Should-Stop:

[Code] ....

View 4 Replies View Related

Fedora :: NBM Service Status Running / Exited

Jun 11, 2011

What is the proper way to make the smb and nmb services start (and keep running) automatically? I have successfully configured samba on my F15 box, but sometimes the other boxes cant see it. I check the status of smb and nmb and smb is running and active, but nmb status is "Running (exited)". If I manually restart nmb then nmb status changes to "Running (active)" and the problem goes away. However I want it to start (and keep running) automatically as it should. I am thinking maybe the problem is the way I set smb and nmb to start automatically.

I used
$chkconfig smb on
and
$chkconfig nmb on

Is this the correct way? if not, what is it? Maybe I need to be more specific about at which runlevels I want the services to start? I have googled, but found about 5 diferent methods to make this services start automatically, some with systemctrl, some editing files, chkconfig, and even the system-config-services app (which seems broken in f15 btw) and don't know which one to use.

View 9 Replies View Related

General :: Check Whether A Service Is Running?

Jan 29, 2010

I run a script manually like/usr/lib/openoffice.org/program/soffice and when I run

:ps -ef|grep openoffice

I get the following,

root 700 1 0 10:45 ? 00:00:00 /bin/sh /usr/lib/openoffice.org/program/soffice -calc

My question is how to check whether this script is running or not (It can be checked every 10 minutes) and how to make it as a service. (I don't have root access to put this in rc.local file or somewhere else).

View 2 Replies View Related

Ubuntu :: Check If Service Is Running?

Jun 20, 2011

I need a script that is able to check if a service is running or not. It has to do it automatic since it is for restarting a GameServer.

I tried to make one myself, but since the .x86 file has the same name for every server, it is hard to know a way to check if the server is running with the right process.

Is there a way to make a script which is able to check if a service is running (service has same name, but using other ports)

View 1 Replies View Related

General :: Check If Service Is Running Or Not Using Java

Feb 26, 2011

i've some trouble to write a script on java on linux to check if service(ie:smbd) is runing or not,, could you give me some example? Or if is there any source about it for me to learn? i've two days search with zero result...

View 5 Replies View Related

General :: Command To Check Whether Service Installed / Running?

Feb 26, 2010

Is there a unique command ( common to all Linux Distros, Solaris, Windows ) to know whether a service is installed and running on my system or not??

View 5 Replies View Related

Programming :: SQL Script To Check Status Of Last Command?

Aug 7, 2009

I need to make a SQL script and call it from Unix (bash) shell.

Code:

sqlplus vikas/vikas <<END
spool /oracle/vikas/output.txt
command 1

[code]....

This runs perfectly, but my problem is that if a command fails, the other commands keeps on running. I need to keep a check that when a command fails the script is exited. In unix we have an option of echo $? to check the status of previous command, But how to accomplish this SQL.

View 2 Replies View Related

Programming :: How To Start/stop Squid Service Using PHP

Oct 21, 2009

Im using PHP and Sun Solaris to do something for Squid Proxy Server. im using......

- LAMP / SAMP
- Linux / Solaris 10
- Squid Server
- PHP

actually i need to know that someone knows about how to start/stop Squid Service using PHP code.

View 2 Replies View Related

Ubuntu Installation :: OpenLDAP Slapd / Can't Stop The Service With Service Slapd Stop?

Oct 20, 2010

I am trying to setup LDAP server on Ubuntu 10.04 and am sticking to the old /etc/ldap/slapd.conf file configuration.

I had to comment ldapi:/// from /etc/default/slapd since it was giving 'Address already in use error'. Also had to juggle with pid directory and file issues

After that I was able to start the slapd daemon (service slapd start) but now I am running into multiple issues:

1. Can't stop the service with service slapd stop

Code:
## Service stop returns 0, maybe because start-stop-daemon is not giving error
#service slapd stop
Stopping OpenLDAP: slapd.
# echo $?
0

Will switching to BDB database resolve this ?Also can't I slapcat at non-root user ??

View 2 Replies View Related

Software :: Error "JBoss Is Still Running - Stop Service First"

May 25, 2010

A script looks as follow:

[code]...

# now we are at the end of all actions exit 0. When I type

[code]...

It should check if a Jboss instance is running. there is no Jboss instance running but it gives always out that "JBoss is still running - please stop the service first". Besides, I've checked with ps -fu $JBOSSUSER | grep -v grep | grep -v Agent | grep java | grep $CONTEXT and the output string is empty. Is there any error in my script?

View 2 Replies View Related

Programming :: Capturing The Exit Status Of The Script Running In Background

Apr 10, 2010

I have a scenario where I am executing some child shell scripts in background (using &)through a master parent script.

Is there a way I can capture the exit status of each individual child script after the execution is completed.

View 7 Replies View Related

Programming :: Script To Check Startup For Start Restart Stop Centos?

Jun 16, 2010

I have startup scriptsI want to test themI need a script to do the followingstart restart stop for 100 times (or i can set how many cycle)

View 1 Replies View Related

Programming :: BASH - Can't Check If XScreenSaver Is Running

Feb 26, 2011

I'm having trouble trying to make a script. What I want to do is check if xScreenSaver is running in my user account. If not, run it. If it's running, kill it.

So this is the script I've made:

Code:

The problem is that I've echoed the output of $(pgrep -u $(whoami) xscreensaver) and it always seems to add 4 numbers to the pid, even if the pid doesn't exist. What do I mean by "doesn't exist"? That no xscreensaver is running in my user, and if I run pgrep -u $(whoami) xscreensaver in bash, I get not output, but if I run the command though the script, I get (for instance) 4050. If I run it again, I get 4054, and again 4058... etc. What the hell is going on with that?

View 5 Replies View Related

Programming :: Check If A Process Is Running - Syntax Error Near Unexpected Token `else'

Feb 10, 2011

I have an ubuntu 10.10 server and want to run a script on it to check if a process is running. If it is not running, it will start the process and also write into a log file.

When running the script i get the following error message:

syntax error near unexpected token `else'

Here is my script.

View 7 Replies View Related

General :: Difference Between Restarting/stopping Apache Using 'service Httpd Restart/stop' And Apachectl Restart/stop

Oct 11, 2010

whats the difference between restarting/stopping apache using 'service httpd restart/stop' and apachectl restart/stop. I know that using 'service httpd restart' is actually a script in /etc/init.d/httpd but what about apachectl?

View 1 Replies View Related

Programming :: Make The Program Check If Either On Of The Input (either $Title Or $Author) Is Not Filled Up

Jan 11, 2010

Title : Author : Price
France : Mark : 40
Persia : John : 50

how i arranged my database. I am trying to write aprogram which does a search either using Title, Author or both.

[Code]....

but i am still unclear on how i am able to make the program check if either on of the input(either $Title or $Author) is not filled up, and if one of it is not filled up, use the other one which is filled to do a search.

View 6 Replies View Related

Programming :: Make Own File As A Running Log?

Apr 1, 2011

I have written a small script from that iam appending the output to a file.If multiple users invoke the same script or if i invoke the same script n number of times (using &), the output file(ZZ/OUT) contains messup information.

++++++++++++++++++++++++++++++++
#!/bin/bash
#

[code]...

View 3 Replies View Related

Software :: Using Service Calypso But - Showing Unknown Status

Oct 8, 2010

We are using one service Calypso but it is showing unknown status. I am using centos 5.0 Linux version and server client env. server and POS which is communucate with each other that is also stop working. after that service stop.

View 1 Replies View Related

Server :: Service HTTPD Status Dead But PID File Exists

Apr 14, 2011

I am using CentOS 5.6 with Apache 2.2.17. The Apache was compiled from source using RPM build to comply with PCI requirements. Also Plesk 9.3 is used as a control panel, but other than the config files the Apache is pretty standard. When the httpd is started, there are no errors reported in /var/log/messages or in the error_log, and the httpd starts, shows up in ps and the pid file exists in /var/run/httpd.pid.

However when you check the status 'service httpd status' you get 'httpd dead but subsys locked'. You can add websites normally, and the proper config files are generated so I am pretty sure this isn't a control panel issue as I have other servers running the same control panel and Apache 2.2.16 compiled and installed the same way as the 2.2.17 and there are no problems.

View 1 Replies View Related

SUSE / Novell :: 11.2 - Stopping Hplip Service Status In Booting?

Nov 26, 2009

I installed HP multifunction inkjet printer.Since then, I'm always noticing the blue HP HPLIP servicestatus icon in the system tray. It appears that I can onlyhide or quit it once it has started.Is there a way not even have it started from the system booting?

View 1 Replies View Related

Programming :: Running Many Tasks In Parallel / But More Clever Than 'make -j'?

Apr 29, 2011

I have a script which basically does many tasks and most of them can run in parallel. The server it runs on has 4 cores, so I changed parts of it to a makefile, and then run them with "make -j 4" which helps a lot. But looking at "top" while it runs, I see it could be improved. Sometimes tasks wait for other servers, so a higher -j value would help. And sometimes multiple tasks are waiting on the same disk, then I think a lower -j value would be better.

The kernel is fairly good at sharing CPU time among the cores, but resources like memory and disks are not shared very well. As an experiment, I tried compiling the kernel with "make -j" with no number. It didn't go very well.

So I wondered if anybody know of a better tool for things like this. I think it should be possible to write something that could change the -j value while it runs.For example:

- Start as many tasks in the background as there are cores. When tasks finish, start another one until done.
- After a little while, check CPU and memory usage to decide if more tasks could run in parallel. Or maybe less?
- If different tasks iowait a lot, check if they wait on the same disk. If so, renice/ionice/suspend some of them. In these situations I think it's better to have them run one after another.
- Other ideas?

I thought of making a script like that, but I doubt I'm the first one with that problem. Also, there are probably lots of things I haven't thought of.

View 5 Replies View Related

Red Hat / Fedora :: How To Check The Network Status

May 20, 2009

want to know what is the cmd to ping/check the link speed or something like Network Info. If for server checking (Show information CPI info) is (cat /proc/cpuinfo ) (correct me if im wrong)

View 4 Replies View Related

Hardware :: How To Check RAID Status

Jul 15, 2009

We have a Dell Poweredge 1750 server with 2 harddrives in RAID 1 running Debian Etch. Yesterday one of the hardrives stopped working but no error message appeared in syslog. The only indication was the amber LED diode. Is there a software way how to check that both disks are OK?

View 5 Replies View Related

General :: Check Status Of A Shell Script?

Aug 2, 2010

I'm running CentOS 5.5 and have created an init script. The start of the script contains:

# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
fi

The start bit works fine, but I'm having problems with the status and stop part:

status)
echo -n "Status of script: "
status "/bin/sh /path/to/script.sh"
RETVAL=$?
echo
;;

In PS AUX the command appears as "/bin/sh /path/to/script.sh" and I can see the PID. But when I run:

./my_init_script status

It says the script is not running. Should I be using the /bin/sh bit, or just the full script path, or just the script filename?

The stop part of the init script utilises "killproc". Again what command should I be using to successfully kill all occurrances of the script?

View 1 Replies View Related

Ubuntu :: How Can I Check Status Of User Partition

Nov 20, 2010

Ubuntu server, no GUI installed; two partitions: OS and user.How can I check the status of the user partition? E.g. Free space, directory, etc

View 2 Replies View Related

Slackware :: Check Proccess Status With /dev/urandom?

Feb 24, 2011

dd is wiping part of the hard drive( 270GB partition ) with /dev/urandom for quite some hours, is there anyway to check the proccess? like speed of the process etc., I read someone doing that with another drive while having access to other terminal because of the system, but since this is directly from the install dvd, I've no clue if there's anyway to do that or not. I'm asking that mainly because:

1) I prefer run things with some kind of verbose mode

2) I accentaly opened the dvd driver (yes I know, but I forgot the install dvd was inside of it), but I closed it right after it, no errors, but it may have stopped working and has just the _ clicking?

View 14 Replies View Related

OpenSUSE :: Get A Message That Says 'Search Service Not Running' With A Button That Says 'Start Search Service'?

Jun 12, 2010

The desktop search has stopped working in Gnome.I get a message that says 'Search Service not running' with a button that says 'Start Search Service'.When I click the button nothing happens

View 1 Replies View Related

Debian :: Unable To Check Status Of A Cups Printer?

Oct 15, 2010

I'm using Debian squeeze and for an assignement, i have create 2 virtual pdf cups printers. Both are working very well. To test the different administion command; i try to disable one of the printer and move his queue file to the second one. I'm able to do it easily.

Now, i wish to write a bash script that wil test the status of the printer. So that,if the printer is disable, it just execute the "move" script. Is there a way to know the status of a cups printer and use that information in a script?

For example, a command/function that can return "O" is the cups printer is enable and "1" if not.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved