[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: OFFTOPIC - Perl link command



On Thu, 2002-04-11 at 06:31, Søren Neigaard wrote:
> Sorry to ask you guys, but I know nothing of Perl, and I'm in desprate need
> of help.
> 
> I have the following code, but it always go into the else statement, even
> thoug the mirror file does not exist - why?
> 
> Is the link command in some kind of Perl module I do not have?
> 

I don't think the problem is the link command not found or you would get
a compiler error.  I would guess that for some reason the creation of
the link is failing.  If I understand your logic you are trying to
create a hardlink from /etc/ha.d/ha.cf to /var/lock/subsys/mirror and if
it fails you are assuming that the link already exists and the process
is still running?

you might try to output $? and $! after the link call and see what the
failure is.  First thing that comes to mind is permissions. Then I
wonder does /etc/ha.d/ha.cf exist.  Are /etc/and var on the same
partition you canot create hardlinks across partitions, you would need
to use symlink instead. 

> #!/usr/bin/perl

<snip>

>                         unlink "/var/lock/subsys/mirror";
> 
>                 } else {
#try something like this  I think $! will still be set properly
			print "link creation failed: $!\nreturn code is $?\n"; 
>                         open(MAIL,"|mail s neigaard\ mobilethink dk");


HTH

Bret





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]