#!/bin/sh
# java-daemon.sh: keeps restarting a buggy server... ;)
WORKINGDIR=/home/mute/test
PIDFILE=cb.pid
cd $WORKINGDIR
echo $$ >$PIDFILE
while true; do
top
done
or a more simple way without checking that it is the correct command running (it's not often the PIDs wrap around and get used for something else...?)
Code:
# check java-daemon.sh's pid instead?
pid=$(cat $PIDFILE 2>/dev/null)
kill -0 $pid 2>/dev/null
if [ "$?" != 0 ]; then
echo "Restarting $DAEMON"
screen -d -m -S $SESSION $DAEMON
fi
This User Gave Thanks to neutronscott For This Post:
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT MINIX
uuidd
UUIDD(8) System Administration UUIDD(8)NAME
uuidd - UUID generation daemon
SYNOPSIS
uuidd [options]
DESCRIPTION
The uuidd daemon is used by the UUID library to generate universally unique identifiers (UUIDs), especially time-based UUIDs, in a secure
and guaranteed-unique fashion, even in the face of large numbers of threads running on different CPUs trying to grab UUIDs.
OPTIONS -d, --debug
Run uuidd in debugging mode. This prevents uuidd from running as a daemon.
-F, --no-fork
Do not daemonize using a double-fork.
-k, --kill
If currently a uuidd daemon is running, kill it.
-n, --uuids number
When issuing a test request to a running uuidd, request a bulk response of number UUIDs.
-P, --no-pid
Do not create a pid file.
-p, --pid path
Specify the pathname where the pid file should be written. By default, the pid file is written to /run/uuidd/uuidd.pid.
-q, --quiet
Suppress some failure messages.
-r, --random
Test uuidd by trying to connect to a running uuidd daemon and request it to return a random-based UUID.
-S, --socket-activation
Do not create a socket but instead expect it to be provided by the calling process. This implies --no-fork and --no-pid. This
option is intended to be used only with systemd(1). It needs to be enabled with a configure option.
-s, --socket path
Make uuidd use this pathname for the unix-domain socket. By default, the pathname used is /run/uuidd/request. This option is pri-
marily for debugging purposes, since the pathname is hard-coded in the libuuid library.
-T, --timeout number
Make uuidd exit after number seconds of inactivity.
-t, --time
Test uuidd by trying to connect to a running uuidd daemon and request it to return a time-based UUID.
-V, --version
Output version information and exit.
-h, --help
Display help screen and exit.
EXAMPLE
Start up a daemon, print 42 random keys, and then stop the daemon:
uuidd -p /tmp/uuidd.pid -s /tmp/uuidd.socket
uuidd -d -r -n 42 -s /tmp/uuidd.socket
uuidd -d -k -s /tmp/uuidd.socket
AUTHOR
The uuidd daemon was written by Theodore Ts'o <tytso@mit.edu>.
SEE ALSO uuid(3), uuidgen(1)AVAILABILITY
The uuidd daemon is part of the util-linux package and is available from the Linux Kernel Archive <https://www.kernel.org/pub/linux/utils
/util-linux/>.
util-linux July 2014 UUIDD(8)