Sponsored Content
Top Forums Shell Programming and Scripting Help scripting to start, check, and restart processes Post 302533372 by neutronscott on Thursday 23rd of June 2011 12:30:34 PM
Old 06-23-2011
Well I didn't actually lose sleep but thought of it. As I said, and tested, using -r started new screens each time chkscreen is ran if I was attached, because it checks for attachable screens and it is not tagged multiattach (maybe yours is in .screenrc?) But -S would just check if the session is running. I see no flaw in such method but maybe someone elses opinion would help.

But if you'd like to check PID, I can do that too. Screen would exit when jd.sh exits, so we'd have jd.sh report its PID with an echo $$ > $PIDFILE

I can write it up later. Mostly when I need my own service script like this, I'd copy one from a simple service in /etc/init.d. I am not famaliar with CentOS's as much, as I use Debian.
This User Gave Thanks to neutronscott For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can I make a program start up automatically after the computer restart/startup?

hi all How can I make a program start up automatically after the computer restart/startup in fedora? something like: ... Establish a shell then run some of command code. Thanks for Help!! (1 Reply)
Discussion started by: munna_dude
1 Replies

2. Shell Programming and Scripting

need help: shell script to restart apache when no. of processes keeps growing

I need a shell script to kill apache and restart it, in case the number of processes keeps growing. The logic is like the below, but I don't know how to get the number and neither the syntax. Could somebody kindly help? if no_of_processes (ps ax ¦ grep httpd) > 200 then killall httpd... (14 Replies)
Discussion started by: _joshua_
14 Replies

3. AIX

How to start/stop/restart NFS on AIX

Hi, Very new to aix How to start/stop/restart NFS on AIX thanks, (2 Replies)
Discussion started by: jredx
2 Replies

4. UNIX for Advanced & Expert Users

Log 'syslog start/stop/restart' messages

How can I tell my syslog.conf to log "syslog start/stop/restart" messages on a Solaris box? (1 Reply)
Discussion started by: SunnyK
1 Replies

5. Shell Programming and Scripting

Start Stop Restart

I'm wondering how I should make a script that can start, stop, and restart another script. What I need to be able to do, is start and stop a perl script from the command line. The easiest way of doing this seems to be to have another script, starting and stopping the other script. I have BASH,... (7 Replies)
Discussion started by: Bakes
7 Replies

6. Shell Programming and Scripting

guarantee to start before restart...

Hi All, is there a way or script that i can check my AIX 5.3 OS will restart before i made restart? is there a script that can check all the startup files are ok before restarting. it is because i was stuck last time when i restart my PC because some startup files were missing:o. (2 Replies)
Discussion started by: malcomex999
2 Replies

7. Solaris

How to start/stop processes

Please anyone tell me In my last interview the HR asks me how to monitor, start,stop & kill the various processes and subprocesses. Please anyone explain me clearly. It's my personal request (3 Replies)
Discussion started by: suneelieg
3 Replies

8. UNIX for Dummies Questions & Answers

Stop/Start vs. Restart

Is there any functional difference between: issuing separate stop/start commands like this; super (handler) (instance) stop super (handler) (instance) start versus issuing a single recycle command like this; super (handler) (instance) restart (3 Replies)
Discussion started by: Newbix
3 Replies

9. Emergency UNIX and Linux Support

Check hung process and restart

Hi all I have networker running on a RHEL 5.7 and over time it hangs. So the solution backup team proposed is to check if the process is hung, to stop and start it. Unfortunately for me, the rc script only allows three commands, start, stop and status (no restart option) so I managed to set... (15 Replies)
Discussion started by: hedkandi
15 Replies

10. Red Hat

Service restart and check if running

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
DMXGetScreenCount(3X)													     DMXGetScreenCount(3X)

NAME
DMXGetScreenCount - determine number of back-end screens SYNOPSIS
#include <X11/extensions/dmxext.h> Bool DMXGetScreenCount(Display *dpy, int *screen_count); DESCRIPTION
DMXGetScreenCount() returns the number of back-end screens that a Xdmx(1) server controls. Since a DMX screen usually fills all of the available area on a back-end server, there is usually a one-to-one correspondence between DMX screens and backend servers. However, it is also possible for a DMX screen to cover only part of the available area on a back-end server, and for more than one DMX screens to occupy different parts of the visible area on the same back-end server. A DMX screen may be managed as a regular X screen in the Xdmx(1) server or may be joined with other DMX screens using Xinerama. RETURN VALUE
DMXGetScreenCount() sets screen_count and returns True unless there is a protocol error. NOTES
If Xinerama is active, only one logical screen will be available to clients of the Xdmx(1) server. However, this call will accurately reflect the number of composite back-end screens that the Xdmx(1) server is using. SEE ALSO
DMXGetScreenAttribtues(3X), DMXChangeScreenAttributes(3X), DMX(3X), Xdmx(1) X Version 11 libdmx 1.0.2 DMXGetScreenCount(3X)
All times are GMT -4. The time now is 09:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy