Nathan,

search_holding_disk should not take the pid file.

Jean-Louis

On 21/11/17 06:49 PM, Nathan Stratton Treadway wrote:
> On Tue, Nov 21, 2017 at 12:57:00 -0500, Nathan Stratton Treadway wrote:
> > > I do not see how Amanda::Util::setup_application call code in 
> holding.c
> >
> > To be precise what I actually saw was activity involving the "pid" files
> > in the holding directory showing up in an strace log. I am not sure how
> > it got called, but assume it was coming from holding.c because it had
> > the arguments for the kill syscall in the correct order (and thus I
> > believe the activity couldn't have been from the then-in-place
> > Holding.pm 
> <http://Holding.pm> 
> code). I will investigate further and let you know what I
> > find.
> >
>
> Okay, sorry for the confusion -- now that I have paid careful attention
> to the part of amflush prior to the Holding::get_all_datestamps() call,
> I see that it's not setup_application() that updates the pid files, but
> rather Disklist:add_holding_to_disklist().
>
> From there the program flow appears to be:
> Amanda::Logfile::search_holding_disk -> find.c:search_holding_disk()
> -> holding.c:holding_get_files() -> holding.c:holding_walk() ->
> holding_dir_stop_if_pid_fn() -> take_holding_pid()
>
> (Obviously the above flow only applies after the holding-pid-3.5.diff
> patch has been applied.)
>
> In any case, the pid file is updated by this call in the early part of
> the amflush run (see below), which explains why the patch for the
> Holding.pm 
> <http://Holding.pm> 
> logic needed to include support for the pid file pointing to
> current/parent pid....
>
>
> (In order to confirm the origin of the pid updates, I added
> system("find /amanda/TestBackup-holding -name pid -ls");
> and a print-message line immediately before and after the call to
> add_holding_to_disklist(), and here is the resulting output:
>
> =====
> # su backup -lc "amflush TestBackup"
> 5636101 4 -rw------- 1 backup backup 5 Nov 21 18:29 
> /amanda/TestBackup-holding/20171121145009/pid
> 5636099 4 -rw------- 1 backup backup 5 Nov 21 18:29 
> /amanda/TestBackup-holding/20171120172656/pid
> **** calling Disklist:add_holding_to_disklist ****
> **** returned from Disklist:add_holding_to_disklist ****
> 5636101 4 -rw------- 1 backup backup 5 Nov 21 18:32 
> /amanda/TestBackup-holding/20171121145009/pid
> 5636099 4 -rw------- 1 backup backup 5 Nov 21 18:32 
> /amanda/TestBackup-holding/20171120172656/pid
> Flushing dumps from 20171121145009 using storage "TestBackup", 
> tapechanger "".
> To volume TESTBACKUP-06 or a new volume, (The last dumps were to 
> volume TESTBACKUP-03
> Flushing dumps from 20171121145009 using storage "TestOffsite", tape 
> changer "doxpop_offsite_vtapes".
> To volume TESTBACKUP-109 or a new volume, (The last dumps were to 
> volume TESTBACKUP-03
>
> Are you sure you want to do this [yN]?
> =====
>
> [I know from my earlier debugging that the value put into the updated
> pid file is actually the parent pid.])
> Nathan
>
>
> ----------------------------------------------------------------------------
> Nathan Stratton Treadway - [email protected] - Mid-Atlantic region
> Ray Ontko & Co. - Software consulting services - http://www.ontko.com/ 
> <http://www.ontko.com/>
> GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt 
> <http://www.ontko.com/~nathanst/gpg_key.txt> 
> ID: 1023D/ECFB6239
> Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239
This message is the property of CARBONITE, INC. and may contain confidential or 
privileged information.
If this message has been delivered to you by mistake, then do not copy or 
deliver this message to anyone.  Instead, destroy it and notify me by reply 
e-mail

Reply via email to