and make it executable, but the username for the file isn't the one with the rights on the process ids.
Is there a way to get this file to be picked up by a script run as root and executed?
The file should be run as soon as it is fully created (like within one minute or so). What would be a better option, run through crontab, or by using a loop / lockfile?
It should be possible to create more than one of these files, so the filename should be variable.
Hi,
I scheduled one script through crontab command and seems like it is hanging. I come to know this through the command 'ps -ef' whcih is showing me the program running, but no chances of it to take more than 2hrs to comlpete.
I want to kill that process. I tried to kill it using the... (6 Replies)
Hey
I'm writing a script that creates some processes,and some scripts which kill those processes.
the question is Simply:
How can I allow a group members to be able to kill (using kill command) processes created by other user at the same group?
and i need the change to be at the script... (5 Replies)
Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it
This is how we execute the script (and this is the requirement) ... (2 Replies)
What I need to learn is how to use a script that launches background processes, and then kills those processes as needed.
The script successfully launches the script. But how do I check to see if the job exists before I kill it?
I know my problem is mostly failure to understand parameter... (4 Replies)
Hi Here is my problem:
1)I am login to unix server through my login id and do SU - xxx
2) Start the script which is running in background
I want that other user which login to there id and do SU - yyy(Different user) kill that
script.
Could you please help me in this. (9 Replies)
How can I kill a process owned by user1? I will be using another user (user2) (not root) and we are on the same primary and secondary group. I copied everything including it's .profile and set the path accordingly.
user1@hostnmae0:/home/user1 $ pkill java
pkill: Failed to signal pid 1234:... (2 Replies)
Hi!
I need your help, please.
I'm in AIX node and sometimes listener process from an oracle instance gets duplicated, i mean that it get spawned a second listener process. As we can't apply changes to the databases on this months, i want to build a shell that can identify the second... (6 Replies)
Hi folks,
I want to kill all process of oracle user and won't kill shell, should i try this? Please confirm.
1st way
pgrep -u oracle | sudo xargs kill -9
2nd way
killall -u oracle (2 Replies)
the task is grant user1 to kill another (for example user2) process. My steps:
by root:
usermod -P "Process Management" user1
login user1
user1@server (~) pfexec kill <PID>
the result is:
ksh: <PID>: not found
or user1@server (~) pfexec pkill <PID>
the result: nothing happens, still... (0 Replies)
Discussion started by: dsyberia
0 Replies
LEARN ABOUT DEBIAN
moose::cookbook::basics::person_buildargsandbuild
Moose::Cookbook::Basics::Person_BUILDARGSAndBUILD(3pm) User Contributed Perl Documentation Moose::Cookbook::Basics::Person_BUILDARGSAndBUILD(3pm)NAME
Moose::Cookbook::Basics::Person_BUILDARGSAndBUILD - Using BUILDARGS and BUILD to hook into object construction
VERSION
version 2.0603
SYNOPSIS
package Person;
has 'ssn' => (
is => 'ro',
isa => 'Str',
predicate => 'has_ssn',
);
has 'country_of_residence' => (
is => 'ro',
isa => 'Str',
default => 'usa'
);
has 'first_name' => (
is => 'ro',
isa => 'Str',
);
has 'last_name' => (
is => 'ro',
isa => 'Str',
);
around BUILDARGS => sub {
my $orig = shift;
my $class = shift;
if ( @_ == 1 && ! ref $_[0] ) {
return $class->$orig(ssn => $_[0]);
}
else {
return $class->$orig(@_);
}
};
sub BUILD {
my $self = shift;
if ( $self->country_of_residence eq 'usa' ) {
die 'Cannot create a Person who lives in the USA without an ssn.'
unless $self->has_ssn;
}
}
DESCRIPTION
This recipe demonstrates the use of "BUILDARGS" and "BUILD". By defining these methods, we can hook into the object construction process
without overriding "new".
The "BUILDARGS" method is called before an object has been created. It is called as a class method, and receives all of the parameters
passed to the "new" method. It is expected to do something with these arguments and return a hash reference. The keys of the hash must be
attribute "init_arg"s.
The primary purpose of "BUILDARGS" is to allow a class to accept something other than named arguments. In the case of our "Person" class,
we are allowing it to be called with a single argument, a social security number:
my $person = Person->new('123-45-6789');
The key part of our "BUILDARGS" is this conditional:
if ( @_ == 1 && ! ref $_[0] ) {
return $class->$orig(ssn => $_[0]);
}
By default, Moose constructors accept a list of key-value pairs, or a hash reference. We need to make sure that $_[0] is not a reference
before assuming it is a social security number.
We call the original "BUILDARGS" method to handle all the other cases. You should always do this in your own "BUILDARGS" methods, since
Moose::Object provides its own "BUILDARGS" method that handles hash references and a list of key-value pairs.
The "BUILD" method is called after the object is constructed, but before it is returned to the caller. The "BUILD" method provides an
opportunity to check the object state as a whole. This is a good place to put logic that cannot be expressed as a type constraint on a
single attribute.
In the "Person" class, we need to check the relationship between two attributes, "ssn" and "country_of_residence". We throw an exception if
the object is not logically consistent.
MORE CONSIDERATIONS
This recipe is made significantly simpler because all of the attributes are read-only. If the "country_of_residence" attribute were
settable, we would need to check that a Person had an "ssn" if the new country was "usa". This could be done with a "before" modifier.
CONCLUSION
We have repeatedly discouraged overriding "new" in Moose classes. This recipe shows how you can use "BUILDARGS" and "BUILD" to hook into
object construction without overriding "new".
The "BUILDARGS" method lets us expand on Moose's built-in parameter handling for constructors. The "BUILD" method lets us implement logical
constraints across the whole object after it is created.
AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for
details.
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-06-28 Moose::Cookbook::Basics::Person_BUILDARGSAndBUILD(3pm)