Sponsored Content
Full Discussion: Writing a Startscript
Top Forums Shell Programming and Scripting Writing a Startscript Post 302930083 by ongoto on Tuesday 30th of December 2014 08:18:41 AM
Old 12-30-2014
RE: status
If you are going to test Pidfile for zero lines,
Code:
if test `ps -e | grep -c $Pid` = 0; then

... try
Code:
> $Pidfile  # instead of echo $! > $Pidfile

when you 'stop' or initialize $Pidfile

Last edited by ongoto; 12-30-2014 at 09:24 AM..
This User Gave Thanks to ongoto For This Post:
 

9 More Discussions You Might Find Interesting

1. Programming

Writing Own Minishell!

Hi, I wanna write my own mini shell as a part of my project. Whole coding is to be donw in C for linux platform. I have got background of linux as well as C but now can anybody please suggest me the sources from where i can find information about how to start ? I have to implement some basic... (4 Replies)
Discussion started by: siddharth_god
4 Replies

2. Programming

writing functions

I have to write a program in C++ using several functions. The program consists of ticket sales how many if you are an adult, junior, or toddler and if there are any discounts. I have the program working up to the pricing function. when i put the discount in the equation it <strike>do</strike>... (1 Reply)
Discussion started by: ravenswind35
1 Replies

3. Solaris

PID / Startscript

Hi, I have a startscript on solaris 10 which does not work properly. #!/sbin/sh PIDFILE=/opt/app_y/PID.log case $1 in 'start') /usr/local/bin/app_y -C /opt/app_y/local.cfg echo $! > $PIDFILE ;; esac exit $? The problem is that the PIDFILE is empty.... (3 Replies)
Discussion started by: victorinox
3 Replies

4. UNIX for Dummies Questions & Answers

Which process is doing all the writing

Hi We are running an IBM P570 with AIX and Unidata. The disk monitor in nmon is showing that one of our logical volumes is hitting 100% most of the time, and that 98% of it is write. I am trying to identify the top processes in terms of disk IO, obviously particularly write so that we... (4 Replies)
Discussion started by: idwalton72
4 Replies

5. UNIX for Dummies Questions & Answers

writing a new file

I have one sample file that contains one question and multiple choice with answer. I need to print the question and answer in another file. Answer is printed next to one of the correct choice. e.g. 1. Capital of USA (A) USA (B) Washington (C) New York (B) (D) New Delhi so i want the... (4 Replies)
Discussion started by: blackeyed
4 Replies

6. Shell Programming and Scripting

Help in writing a script

Hey everyone Can anyone please write me a script to display numbers in descending order dynamically i.e if the user enter a number say 100 then the output should be like 100 99 ....so on till 0 I tried using the logic as for ((i =1; i<=100; i--) but the it goes into a infinite loop since even the... (7 Replies)
Discussion started by: icchi
7 Replies

7. AIX

hacmp application startscript issue

Hi, I am setting up a hacmp oracle cluster with 2 resource groups - one on each node. Binaries are local - so is configuration but its the same on both nodes - so are the startscripts. If I start the cluster, each DB comes up nicely on its homenode. Now I have the problem that when I... (1 Reply)
Discussion started by: zxmaus
1 Replies

8. How to Post in the The UNIX and Linux Forums

Help with script writing?

I am new for script writing. I have a file named as name.dat and contain numbers with different rows and columns. I want to sum numbers at one row with that of at another row; like row1 + row101 + row 201, with corresponding columns. Any one can help me to write a script for this operation. ... (1 Reply)
Discussion started by: kumnegert
1 Replies

9. Shell Programming and Scripting

Not writing output

In the attached bash in the convert function the out_position.txt in not being writing to the annovar directory and I can not figure out why. Thank you :). (2 Replies)
Discussion started by: cmccabe
2 Replies
MooseX::Daemonize::WithPidFile(3pm)			User Contributed Perl Documentation		       MooseX::Daemonize::WithPidFile(3pm)

NAME
MooseX::Daemonize::WithPidFile - A Role with the core daemonization and pidfile management SYNOPSIS
package My::Daemon; use Moose; with 'MooseX::Daemonize::WithPidFile'; sub start { my $self = shift; # daemonize me ... $self->daemonize; # << this will write the pidfile for you # return from the parent,... return unless $self->is_daemon; # but continue on in the child (daemon) } DESCRIPTION
This is a slightly extended basic daemonization Role, it provides Pidfile management along with the core daemonization features found in MooseX::Daemonize::Core. ATTRIBUTES
pidfile (is = rw, isa => MooseX::Daemonize::Pid::File)> This attribute holds the MooseX::Daemonize::Pid::File object used to manage the Pidfile. It will initialize the object using the "init_pidfile" method (which is required by this role). REQUIRED METHODS
init_pidfile This method is used to build the pidfile attribute's object. It should return a MooseX::Daemonize::Pid::File object. has_pidfile This is a predicate method to tell you if your pidfile attribute has been initialized yet. METHODS
daemonize This adds an "after" method modifier to the "daemonize" method (from MooseX::Daemonize::Core) and handles writing your Pidfile for you. meta The "meta()" method from Class::MOP::Class DEPENDENCIES
Moose::Role, MooseX::Getopt and MooseX::Daemonize::Pid::File INCOMPATIBILITIES
None reported. BUGS AND LIMITATIONS
No bugs have been reported. Please report any bugs or feature requests to "bug-acme-dahut-call@rt.cpan.org", or through the web interface at <http://rt.cpan.org>. AUTHOR
Stevan Little "<stevan.little@iinteractive.com>" LICENCE AND COPYRIGHT
Copyright (c) 2007-2011, Chris Prather "<perigrin@cpan.org>". All rights reserved. Portions heavily borrowed from Proc::Daemon which is copyright Earl Hood. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. perl v5.14.2 2012-05-31 MooseX::Daemonize::WithPidFile(3pm)
All times are GMT -4. The time now is 07:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy