Re: [PATCH] debian: symlink mdmon pidfile into /run/sendsigs.omit.d

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

 



On Fri, 24 Aug 2012 13:49:52 +0200 Miquel van Smoorenburg <mikevs@xxxxxxxxxx>
wrote:

> On 24-08-12 1:12 PM, Dmitrijs Ledkovs wrote:
> > On 24 August 2012 10:57, Miquel van Smoorenburg <mikevs@xxxxxxxxxx> wrote:
> >> Some daemons should not be killed when the system is shutting down. In
> >> debian this is achieved by putting a file with the pid of the daemon in it
> >> in /run/sendsigs.omit.d (or a symlink to its pidfile).
> >>
> >> This patch lets mdmon automatically create a symlink in /run/sendsigs.omit.d
> >> to its pidfile.
> >>
> >> See also debian bug 684708 at
> >> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684708  ,
> >> where I submitted a previous version of this patch.
> >>
> >> Comments welcome.
> >>
> >
> > For upstream, it might be more appropriate to have a configurable
> > MDMON_PIDDIR, which defaults to $MDMON_DIR. As far as I know,
> > sendssigs.omit.d is very specific to Debian and it's derivatives, and
> > it's not used in the brave new systemd world.

No, the "brave new systemd world" requires that $ARGV[0] start with '@' to
avoid being killed, and mdmon has special code to support that.
So it would not be unreasonable to add special code to support
sendsigs.omit.d.

However if we only need to protect things at shutdown I wonder it you could
just add something like:

 cd /run/mdadm/
 for file in md*.pid
 do ln -s /run/mdadm/$file /.../sendsigs.omit.d/mdadm-$file
 done

in some script that gets run before the 'killall' happens.

That would be simple and should work.

If we really need mdmon to create the symlink I'd want:
1/ the compiled-in path (SENDSIGS_OMIT_DIR) to contain a %s which is replaced
by the devname, so e.g.
    -DSENDSIGS_OMIT_DIR=/var/run/omit.dir/mdmon-%d.pid

and probably use asprintf rather than a fixed size buffer that the proposed
patch uses (yes, I know I used fixed size buffers all the time.  I'm bad -
show my how much better a real coder can do and I might learn to change my
ways!! :-)

Thanks,
NeilBrown



> 
> Well, I'm not sure if there's a guideline for this in debian, but the 
> convention appears to be to put the pidfiles in /run or a 
> package-specific subdir of /run, and then to create a symlink from the 
> sendsigs.omit.d directory to the pidfile- which is exactly what this 
> patch does. If you're saying that something debian-specific like this 
> should not be in the upstream package, then that's fine, and the patch 
> will just be carried in debian. No problem.
> 
> Note that I am not the debian mdadm maintainer, it's just that often 
> it's appreciated if a bug/patch submitter works with upstream.
> 
> Thanks,
> 
> Mike.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux