09-08-2009
Restart a Service!!
Hello, I am trying to write a script which will monitor few processes(winbind) for cpu utilization, If the process consumes more than say 99% cpu for 3 minutes, I want to run a script to restart the service which forks the process.
---------- Post updated at 11:21 AM ---------- Previous update was at 11:12 AM ----------
The Logic I am trying to use is grep for winbind from ps output.
ps -eo pcpu,pid,user,args,cputime | grep winbind|grep -v grep
0.0 18339 root winbindd 00:00:00
0.0 18343 root winbindd 00:00:00
0.0 18344 root winbindd 00:00:00
0.0 18397 root winbindd 00:00:00
Now add the total of left most column and see if its greater than 99%. If its consistently above 99% for 3 or 5 minutes, then do `/etc/init.d/winbind restart`.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
For vertitas netbackup 6.0
I have media server :Solaris
Client server: Windows
I want to restart the netbackup service on the media server .
plz suggest ASAP. (1 Reply)
Discussion started by: saurabh84g
1 Replies
2. Solaris
Can any one please tell me the command for NFS client service restart.This is to resolve, NFS mount slowness issue.Mount is very slow for both read and write operations.The below commands are not helping out in this situation.
---------- Post updated at 08:59 AM ---------- Previous update was... (1 Reply)
Discussion started by: ksvaisakh
1 Replies
3. HP-UX
Hi All,
May i please know if it is possible to write a script to check the log messages and automatically restart a service if it is failed or it is stopped.
Appreciate your suggestions.
Thanks in advance.
regards,
Eajaz (2 Replies)
Discussion started by: ajazshariff
2 Replies
4. Shell Programming and Scripting
Hi All,
Requirement : I need to check for some services in my environment and restart the service if its not running.
I have written script to check the script if its running or not. While if its not running i need to restart it using ./start command. But it will ask for password prompt and i... (4 Replies)
Discussion started by: pradeepbaliga
4 Replies
5. Shell Programming and Scripting
Hello,
Currently i am handling admin activity of wasserver, its parts of teamcenter,
wasserver is used to maintain IDSM service which is involved in data transfer activity. due to some reason IDSM service gets down and have to restart this service manually. ... (0 Replies)
Discussion started by: chetan0412
0 Replies
6. SuSE
Hi,
Beside using crontab, what is other application we can set it? Normally I check using command crontab -l.
Any other path I need to check? Please guide me.
Thanks. (2 Replies)
Discussion started by: mzainal
2 Replies
7. Shell Programming and Scripting
hi ,
can anyone please tell me to how to restart a service without root or i need a root access for it.
as a user i am getting this type of error :
nkchand@(tendcer0h1) nkchand $ service /opt/Nimsoft/bin/niminit stop
ksh: service: not found. (1 Reply)
Discussion started by: nkchand
1 Replies
8. Red Hat
Hello,
I'l like to create a script that restart a service (/etc/init.d/httpd restart) and also check if after restart the service is actually running. Sometimes it happen that at the first try the service fails to restart.
Thanks (2 Replies)
Discussion started by: bazzola
2 Replies
9. Red Hat
Hello
How do I restart init.d ?? (centos 6.5)
Thanks (2 Replies)
Discussion started by: mnnn
2 Replies
10. Red Hat
When I update the server with new SSL certificates, and restart httpd, I get errors :
# service httpd restart
Stopping httpd:
rm: cannot remove `/usr/local/apache2/bin/httpd/logs/httpd.pid': Not a directory
Starting httpd: ... (0 Replies)
Discussion started by: anaigini45
0 Replies
LEARN ABOUT DEBIAN
cifs.idmap
CIFS.IDMAP(8) System Administration tools CIFS.IDMAP(8)
NAME
cifs.idmap - Userspace helper for mapping ids for Common Internet File System (CIFS)
SYNOPSIS
cifs.idmap [--version|-v] {keyid}
DESCRIPTION
This tool is part of the cifs-utils suite.
cifs.idmap is a userspace helper program for the linux CIFS client filesystem. There are a number of activities that the kernel cannot
easily do itself. This program is a callout program that does these things for the kernel and then returns the result.
cifs.idmap is generally intended to be run when the kernel calls request-key(8) for a particular key type. While it can be run directly
from the command-line, it is not generally intended to be run that way.
cifs.idmap works in conjuction with winbind facility of Samba suite to map owner and group SIDs to uids and gids respectively. It is best
utilized when
- a mount option of cifsacl is specified when mounting a cifs share
- winbind is specified as one of the search entries for passwd and group databases in file /etc/nsswitch.conf
- file smb.conf has winbind specific entries
- winbind daemon program is running
In case winbind and cifs.idmap facilities are unavailable, file objects in a mounted share are assigned uid and gid of the credentials of
the process that mounted the share. So it is strongly recomemended to use mount options of uid and gid to specify a default uid and gid to
map owner SIDs and group SIDs respectively in case services of winbind and cifs.idmap facility are unavailable.
OPTIONS
--version|-v
Print version number and exit.
CONFIGURATION FOR KEYCTL
cifs.idmap is designed to be called from the kernel via the request-key callout program. This requires that request-key be told where and
how to call this program. Currently cifs.idmap handles a key type of:
cifs.idmap
This keytype is for mapping a SID to either an uid or a gid
To make this program useful for CIFS, you will need to set up entry for it in request-key.conf(5). Here is an example of an entry for this
key type:
#OPERATION TYPE D C PROGRAM ARG1 ARG2...
#========= ============= = = ================================
create cifs.idmap * * /usr/sbin/cifs.idmap %k
See request-key.conf(5) for more info on each field.
NOTES
Support for upcalls to cifs.idmap was initially introduced in the 3.0 kernel.
SEE ALSO
request-key.conf(5), mount.cifs(8)
AUTHOR
Shirish Pargaonkar wrote the cifs.idmap program.
The Linux CIFS Mailing list is the preferred place to ask questions regarding these programs.
cifs-utils 05/26/2011 CIFS.IDMAP(8)