Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Unable to mailx new $pid for a script restart Post 302817999 by olyanderson on Thursday 6th of June 2013 06:46:11 PM
Old 06-06-2013
HP

thanks for the response, i appreciate it.

welp the first thing is, i check if the other batch is running,

if it is NOT running $pid="" (empty) which means there is no pid running with that grep, THEN, restart the process, then exit.

If it is running, the current or new pid started moments ago with above NOT statement, THEN, simply do nothing, echo "running", no log needed.

If it is NOT running, restart, grab the NEW $pid and email that new pid with mailx, AND echo the restarted to the log file.

everything is a go, perms wise, this script restarts the dead script. but it hangs, i want it to ALSO exit out with zero exit status and recheck via crontab every 1 min. this is a HA server, and needs constant babying lol. it doesn't cry much, but when it does, people lose jobs.

thanks for your help again, i appreciate it.
anymore input, just ask Smilie
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unable to do mailx from shell script

Hi From within a shell script my mailx doesnt seem to work...can somebody tell me what is wrong... #!/bin/ksh #Script to verify wheather all databases listed are up and running #Script works with Oracle8 and above databases #Script has to be run by ./scriptname DBA=xiamin@unix.com echo... (3 Replies)
Discussion started by: xiamin
3 Replies

2. Linux

mailx: Unable to send Japanese

Hi All, I am facing problem in sending Japanese characters using mailx command in GNU linux machine. The mail is going with junk characters like "メールの-界へようこそ". I tried changing the LANG value to japan locale off UTF-8. But it doesn't worked. I have to send the data as body not as an... (0 Replies)
Discussion started by: Karteek
0 Replies

3. Solaris

Unable to send mail through mailx

Hi, I am using solaris 5.9 OS and I am facing an issues with mailx. My SMTP port is configured to listen 6190 and not the default one which is 25. I can send mail to my inbox when i do it manually through the following steps root@<dbname> # telnet 15.12.88.10 6190 Trying 15.12.88.10...... (0 Replies)
Discussion started by: Srinathkiru
0 Replies

4. HP-UX

[Solved] mailx : unknown user issue

Hi all, I know this issues has been discussed multiple times, i have gone through many such discussion but unfortunately i am still not able to solve the issue being faced. I have configured the sendmail.cf with the smtp host name (Editing the entry starting with DS...) Post that restarted... (7 Replies)
Discussion started by: chpsam
7 Replies

5. Shell Programming and Scripting

[Solved] Unable to call a python script from bash

Hi, I am trying to run a python script embedded in bash script. But is throwing me an error. Please help. Script: #!/bin/bash nohup /usr/bin/python /opt/web/http.py & Error: /usr/bin/python: can't open file '/opt/web/http.py': No such file or directory Please help me on this. (6 Replies)
Discussion started by: maddy26615
6 Replies

6. Red Hat

Can't stop/restart postfix - pid associated with another process

This issue could happen to any other service but in this case its commssioning Postfix - it seems i can't stop postfix as the PID relates to another service - i've delete the 'master.lock' but to no available - any ideas, memeory commands etc ? thanks in advance ps. the serve is in Production so... (2 Replies)
Discussion started by: stevie_velvet
2 Replies

7. Shell Programming and Scripting

Unable to get pid from fuser

bash-3.2$ fuser -f /bin/nohup.out /bin/nohup.out: 13136o 13111o The pid is 13136. Can you tell me how can i extract just the pid 13136 from the above output ? bash-3.2$ uname -a SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v I was trying on this lines but i get strange... (3 Replies)
Discussion started by: mohtashims
3 Replies
COURIERLOGGER(1)					      Double Precision, Inc.						  COURIERLOGGER(1)

NAME
courierlogger - Courier syslog wrapper SYNOPSIS
courierlogger [-name=title] [-facility=subsystem] [-pid=filename] [-user=user] [-group=group] [-droproot] [[[-respawn] [-start] program [argument...]] | [-stop] | [-restart]] DESCRIPTION
courierlogger is a wrapper that captures another process's error messages, and forwards them to the system logging facility, "syslog". There are two ways to use courierlogger: 1. Use the shell to pipe another command's standard error, and/or its standard output, to courierlogger's standard input. 2. Alternatively, courierlogger itself can start another process, and arrange to have its standard error captured. In either case, each read line of text is sent as a syslog message. OPTIONS
-name=title Use title for sending messages to syslog. title should be the application's name. -facility=subsystem Use subsystem for classifying messages. Your syslog facility uses subsystem to determine which log messages are recorded in which log files. The currently defined subsystems are: o auth o authpriv o console o cron o daemon o ftp o kern o lpr o mail o news o security o user o uucp o local0 o local1 o local2 o local3 o local4 o local5 o local6 o local7 Note Not all of the above facility names are implemented on every system. Check your system's syslog documentation for information on which facility names are allowed, and which log files record the corresponding messages for each facility. -pid=filename Save courierlogger's process ID in filename. The -pid option is required when -start, -stop, -restart are given. If -pid is given without any of these, -start is assumed. -start Run as a daemon. The pid option is required. courierlogger will quietly terminate if another courierlogger process is already running. This is used to make sure that only one instance of program is running at the same time. Specify a different filename with pid to start a second copy of program. -respawn Restart program if it terminates. Normally courierlogger itself will terminate when program finishes running. Use respawn to restart it instead. -restart Send a SIGHUP signal to the courierlogger process (as determined by examining the contents of the file specified by pid), which will in turn send a SIGHUP to its child program. Does nothing if courierlogger is not running. Note program must be originally started with the respawn option if sending it a SIGHUP causes it to terminate. The same thing may be accomplished by sending SIGHUP to courierlogger itself. -stop Send a SIGTERM signal to courierlogger, which in turn forwards it on to program. If program does not terminate in 8 seconds, kill it with SIGKILL. -user=user, -group=group If running as root, change credentials to the given user and/or group, which may be given as names or numeric ids. When running a child program, it is started before privileges are dropped (unless the -droproot option is also given). This gives a means of starting a child as root so it can bind to a privileged port, but still have courierlogger run as a non-root user. For the -stop and -restart options to work, you should configure the child program to drop its privileges to the same userid too. -droproot Drop root privileges before starting the child process. The -user and -group options specify the non-privileges userid and groupid. Without the -droproot option the child process remains a root process, and only the parent courierlogger process drops root privileges. program [ argument ] ... If a program is given program will be started as a child process of courierlogger, capturing its standard error. Otherwise, courierlogger reads message from standard input, and automatically terminates when standard input is closed. SEE ALSO
couriertcpd(1)[1], your syslog man page. NOTES
1. couriertcpd(1) couriertcpd.html Double Precision, Inc. 08/23/2008 COURIERLOGGER(1)
All times are GMT -4. The time now is 11:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy