Re: [PATCH 1/2] uuidd: require use of --socket-activation when run as systemd service

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

 



On Mon, 8 Aug 2016, Karel Zak wrote:

> On Wed, Aug 03, 2016 at 11:41:57PM +0100, Sami Kerola wrote:
> > Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
> > ---
> >  misc-utils/uuidd.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
> > index a3fe830..77c967d 100644
> > --- a/misc-utils/uuidd.c
> > +++ b/misc-utils/uuidd.c
> > @@ -651,6 +651,13 @@ int main(int argc, char **argv)
> >  	else if (pidfile_path_param)
> >  		pidfile_path = pidfile_path_param;
> >  
> > +#ifdef HAVE_LIBSYSTEMD
> > +	if (getppid() == 1 && 0 < sd_booted() &&
> > +	    (!uuidd_cxt.no_sock || !uuidd_cxt.no_fork || !no_pid))
> > +		errx(EXIT_FAILURE,  _("cannot run as systemd service "
> > +				      "without --socket-activation"));
> > +#endif
> 
>  Why? 
>  
>  I do not test it, but I guess --socket-activation is always an
>  optional way. It's enabled by default in systemd unit files, but I
>  guess for some test purpose you can use old way to start uuid
>  independently on your initd. Right?

My thinking with this was that when software can detect correct
invocation it should. In this case when uuidd is started by
systemd then incorrect option usage in service file should
cause an error.

But indeed, perhaps an unnecessary change so I'm not going to
push this any further.

-- 
Sami Kerola
http://www.iki.fi/kerolasa/
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux