Sponsored Content
Top Forums Programming autostart script for stopped services Post 302555090 by kitt on Tuesday 13th of September 2011 09:24:39 PM
Old 09-13-2011
I think it be some cross platform way
PHP Code:
#!/usr/bin/perl

use strict;
use 
warnings;
use 
Proc::Daemon;

Proc::Daemon::Init;

my $continue 1;
$SIG{TERM} = sub $continue };

while (
$continue) {
     
#do stuff

 

10 More Discussions You Might Find Interesting

1. HP-UX

rc.log problem about autostart script

On HP-UX, we add some our autostart scripts in the system script under /sbin/rc*.d directory. The output of application is redirected to /dev/null in our script,but once the application has been startup with the OS starting,its ouput is redirected to the /etc/rc.log finally and cause the rc.log... (2 Replies)
Discussion started by: Frank2004
2 Replies

2. UNIX and Linux Applications

Autostart/Autorun Applications

I have developed a CD that runs both Windows and Mac software. I would like it to function as an autorun/autostart; I do not have a problem with the Windows code, but I do for the Mac. I do not feel like investing a couple of hundred $$$ into software, when, I am sure that several lines of UNIX... (2 Replies)
Discussion started by: HornetDr
2 Replies

3. Shell Programming and Scripting

why my script stopped- any reason(urgent please)

Hi Friends, iam running some scripts, which are all off suddenly stopping. Can any one tell me the reason why it happend. Is there any reason to stop the scripts. Thanks Krishna. (1 Reply)
Discussion started by: krishna9
1 Replies

4. AIX

Autostart of LPAR

Hi, I have 2 lpars on my AIX that needs to be started manually after each reboot. Because the servers are storing the NFS and NIS info, other servers won't run correctly until they start up. I found in IBM documentation the steps to make it automatic. My question is, I want to know if... (2 Replies)
Discussion started by: rahzzbietel
2 Replies

5. Debian

Iomega ix2-200 Custom Debian - Autostart script in init.d not Working

!!Hello Everyone!! I Recently purchased a Iomega iX2-200 NAS that runs a custom debian installed by Iomega (Linux Debian 5.0.2 ( 2.6.22.18 armv5tejl)) . I have SSH access. I installed Transmission since the factory installed torrents manager that Iomega uses is terrible. Transmission-daemon... (1 Reply)
Discussion started by: stejimenez
1 Replies

6. UNIX for Advanced & Expert Users

stopped(sigttou) error while executing a script in background

Hi All, I have an issue where in when i execute a script in the background using '&', it exits with stopped(SIGTTOU) signal. There are two servers, where the Compute server is HP-Unix and Data server is Linux. I tried using the "stty - tostop" command to disable the SIGTTOU for background... (1 Reply)
Discussion started by: vmenon
1 Replies

7. Shell Programming and Scripting

shell script getting stopped at the middle.

I have created a shell scrit to run the informatica workflows sequentially.In the script i am executing 7 workflows sequentially after running 4 workflows the scrpt getting stop and it is not continuing next step evn it is updating logs.4th workflow will take more time to finish is that making... (1 Reply)
Discussion started by: katakamvivek
1 Replies

8. Shell Programming and Scripting

Script to Start services based on dependent services on other AIX machine

Hi, I just started working on a script. After my research, i found a command which can help me: AIM: To build a script which starts the services (Services 1) on server 1 automatically whenever its down. And it has a dependency on other service (Service 2) on Server 2. So my script has to... (4 Replies)
Discussion started by: draghun9
4 Replies

9. Shell Programming and Scripting

Perl script stopped working

Hi, I have the following segment of a script which is supposed to prompt a user for password and then capture the password entered by the user. The function is called in by another script and used to work without issue, the problem is that recently the script is not waiting for the user to... (3 Replies)
Discussion started by: belalr
3 Replies

10. Shell Programming and Scripting

Korn Shell script in stopped state while running in background

Hi, I want to run a shell script in background . but its going to stopped state $ ksh cat_Duplicate_Records_Removal.ksh & 8975 $ + Stopped (tty output) ksh cat_Duplicate_Records_Removal.ksh & why is this happening? Also could anyone please tell me what is a stopped... (12 Replies)
Discussion started by: TomG
12 Replies
stopped(7)                                               Miscellaneous Information Manual                                               stopped(7)

NAME
stopped - event signalling that a job has stopped SYNOPSIS
stopped JOB=JOB INSTANCE=INSTANCE RESULT=RESULT [PROCESS=PROCESS] [EXIT_STATUS=STATUS] [EXIT_SIGNAL=SIGNAL] [ENV]... DESCRIPTION
The stopped event is generated by the Upstart init(8) daemon when an instance of a job has stopped. The JOB environment variable contains the job name, and the INSTANCE environment variable contains the instance name which will be empty for single-instance jobs. If the job was stopped normally, the RESULT environment variable will be ok, otherwise if the job was stopped because it has failed it will be failed. When the job has failed, the process that failed will be given in the PROCESS environment variable. This may be pre-start, post-start, main, pre-stop or post-stop; it may also be the special value respawn to indicate that the job was stopped because it hit the respawn limit. Finally in the case of a failed job, one of either EXIT_STATUS or EXIT_SIGNAL may be given to indicate the cause of the stop. Either EXIT_STATUS will contain the exit status code of the process, or EXIT_SIGNAL will contain the name of the signal that the process received. The normal exit job configuration stanza can be used to prevent particular exit status values or signals resulting in a failed job, see init(5) for more information. If neither EXIT_STATUS or EXIT_SIGNAL is given for a failed process, it is because the process failed to spawn (for example, file not found). See the system logs for the error. init(8) emits this event as an informational signal, services and tasks started or stopped by this event will do so in parallel with other activity. It is typically combined with the starting(7) event by services when inserting themselves as a dependency. Job configuration files may use the export stanza to export environment variables from their own environment into the stopped event. See init(5) for more details. EXAMPLE
A service that wishes to be running whenever another service would be running, started before and stopped after it, might use: start on starting apache stop on stopped apache A task that must be run after another task or service has been stopped might use: start on stopped postgresql SEE ALSO
starting(7) started(7) stopping(7) init(5) Upstart 2009-07-09 stopped(7)
All times are GMT -4. The time now is 10:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy