[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dd killed with USR1 right after ftruncate()
From: |
Pádraig Brady |
Subject: |
Re: dd killed with USR1 right after ftruncate() |
Date: |
Thu, 13 Aug 2009 11:45:49 +0100 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
Voelker, Bernhard wrote:
> Hi *,
>
> short question:
> is there a particular reason why the signal handlers are installed after
> ftruncate() in dd?
>
> Long story:
> I ran dd for a new backup of my 150GB partition to an external USB drive
> while I started
> while kill -USR1 pid ; do sleep 30 ; done
> in a separate terminal. The target file already existed and reflected a
> previous backup.
> After a while, dd ended with the standard USR1 signal handler.
> The only work done so far was to truncate the old output file.
> So my guess was that installing the signal handler for SIGUSR1 is done after
> the truncation. So I looked into the latest sources (coreutils-7.4) and found
> out
> that my guess was right:
>
> if (ftruncate (STDOUT_FILENO, size) != 0)
> {
> <snipped />
> }
> }
> #endif
> }
> install_signal_handlers ();
>
> So why does ftruncate() before install_signal_handlers()?
What is your exact dd command please, and destination file system.
I'm a bit confused as ftruncate is not called unless you specify a
non zero seek= but that seems a bit weird from your described usage.
Also I'm confused as to why a non zero seek would take "a while".
On vfat I suppose, but that only supports 4G files, not 150G.
You're right though in that the signal handlers are installed
just around the copy. I need to double check if that's by design.
cheers,
Pádraig.
- dd killed with USR1 right after ftruncate(), Voelker, Bernhard, 2009/08/12
- Re: dd killed with USR1 right after ftruncate(),
Pádraig Brady <=
- AW: dd killed with USR1 right after ftruncate(), Voelker, Bernhard, 2009/08/13
- Re: AW: dd killed with USR1 right after ftruncate(), Jim Meyering, 2009/08/13
- Re: AW: dd killed with USR1 right after ftruncate(), Pádraig Brady, 2009/08/13
- AW: AW: dd killed with USR1 right after ftruncate(), Voelker, Bernhard, 2009/08/13
- Re: AW: AW: dd killed with USR1 right after ftruncate(), Pádraig Brady, 2009/08/13
- Re: AW: AW: dd killed with USR1 right after ftruncate(), Jim Meyering, 2009/08/13
- Re: AW: dd killed with USR1 right after ftruncate(), Jim Meyering, 2009/08/13