Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Argument to start_daemon, use of -- (http://www.linux-archive.org/debian-user/406983-argument-start_daemon-use.html)

Malte Forkel 08-01-2010 02:03 PM

Argument to start_daemon, use of --
 
Hi,

The example init script init.d.lsb.ex provided by dh-make 0.46 contains
this call to start_daemon:

start_daemon -p $PIDFILE $DAEMON -- $DAEMON_OPTS

This always passes "--" as first argument to my daemon. Wouldn't

start_daemon -p $PIDFILE -- $DAEMON $DAEMON_OPTS

be the proper call?

I haven't found a reference to "--" in the LSB init function
documentation, but the implementation of start_daemon in
/lib/lsb/init-function (from lsb-base) handles "--" explicitly. The use
of "--" is documented in bash(1) though. Is this a convention? What
status has it?

Thanks,
Malte


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: i33ur9$552$1@dough.gmane.org">http://lists.debian.org/i33ur9$552$1@dough.gmane.org

Jordon Bedwell 08-01-2010 02:26 PM

Argument to start_daemon, use of --
 
On 8/1/2010 9:03 AM, Malte Forkel wrote:

Hi,

The example init script init.d.lsb.ex provided by dh-make 0.46 contains
this call to start_daemon:

start_daemon -p $PIDFILE $DAEMON -- $DAEMON_OPTS

This always passes "--" as first argument to my daemon. Wouldn't

start_daemon -p $PIDFILE -- $DAEMON $DAEMON_OPTS

be the proper call?

I haven't found a reference to "--" in the LSB init function
documentation, but the implementation of start_daemon in
/lib/lsb/init-function (from lsb-base) handles "--" explicitly. The use
of "--" is documented in bash(1) though. Is this a convention? What
status has it?

Thanks,
Malte




According to the man page it should be:
start_daemon -p $PIDFILE $EXECUTABLE $EXECTUABLE_OPTS


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4C55841C.6090704@envygeeks.com">http://lists.debian.org/4C55841C.6090704@envygeeks.com

Malte Forkel 08-02-2010 08:36 AM

Argument to start_daemon, use of --
 
Am 01.08.2010 16:26, schrieb Jordon Bedwell:
> On 8/1/2010 9:03 AM, Malte Forkel wrote:
>> Hi,
>>
>> The example init script init.d.lsb.ex provided by dh-make 0.46 contains
>> this call to start_daemon:
>>
>> start_daemon -p $PIDFILE $DAEMON -- $DAEMON_OPTS
>>
>> This always passes "--" as first argument to my daemon. Wouldn't
>>
>> start_daemon -p $PIDFILE -- $DAEMON $DAEMON_OPTS
>>
>> be the proper call?
>>
>> I haven't found a reference to "--" in the LSB init function
>> documentation, but the implementation of start_daemon in
>> /lib/lsb/init-function (from lsb-base) handles "--" explicitly. The use
>> of "--" is documented in bash(1) though. Is this a convention? What
>> status has it?
>>
>> Thanks,
>> Malte
>>
>>
>
> According to the man page it should be:
> start_daemon -p $PIDFILE $EXECUTABLE $EXECTUABLE_OPTS
>
>

So its a bug that I should report?



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: i3602p$les$1@dough.gmane.org">http://lists.debian.org/i3602p$les$1@dough.gmane.org

Jordon Bedwell 08-02-2010 11:17 AM

Argument to start_daemon, use of --
 
On 8/2/2010 3:36 AM, Malte Forkel wrote:

So its a bug that I should report?


If the -- is in a Debian specific script from a maintainer I would, and
post the proof that -- is being passed to the executable before _OPTS
and ask them if this is intended and then explain to them how it breaks
whatever it breaks and point to the man page.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4C56A94A.9060702@envygeeks.com">http://lists.debian.org/4C56A94A.9060702@envygeeks.com

Bob Proulx 08-02-2010 03:45 PM

Argument to start_daemon, use of --
 
Malte Forkel wrote:
> The example init script init.d.lsb.ex provided by dh-make 0.46 contains
> this call to start_daemon:
> start_daemon -p $PIDFILE $DAEMON -- $DAEMON_OPTS
> This always passes "--" as first argument to my daemon. Wouldn't
> start_daemon -p $PIDFILE -- $DAEMON $DAEMON_OPTS
> be the proper call?

It does seem that way to me too.

> I haven't found a reference to "--" in the LSB init function
> documentation, but the implementation of start_daemon in
> /lib/lsb/init-function (from lsb-base) handles "--" explicitly. The use
> of "--" is documented in bash(1) though. Is this a convention? What
> status has it?

It was a convention and is now a standard.

http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02

Guideline 10:
The argument -- should be accepted as a delimiter indicating the
end of options. Any following arguments should be treated as
operands, even if they begin with the '-' character. The --
argument should not be used as an option or as an operand.

It marks the end of option argument processing. Subsequent arguments
should not be treated as options even if they start with a dash. This
enables processing of files that begin with a dash. Like this for
example:

$ touch ./--help
$ rm -f -- --help

Bob

Malte Forkel 08-05-2010 11:53 AM

Argument to start_daemon, use of --
 
Am 01.08.2010 16:03, schrieb Malte Forkel:
>
> The example init script init.d.lsb.ex provided by dh-make 0.46 contains
> this call to start_daemon:
>
> start_daemon -p $PIDFILE $DAEMON -- $DAEMON_OPTS
>
> This always passes "--" as first argument to my daemon. Wouldn't
>
> start_daemon -p $PIDFILE -- $DAEMON $DAEMON_OPTS
>
> be the proper call?
>

Thanks for all of your input.

I have filed a bug report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591747 (#591747 -
/usr/share/debhelper/dh_make/debian/init.d.lsb.ex: init.d.lsb.ex passes
-- as first argument to daemon - Debian Bug report logs)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: i3e8ok$utb$1@dough.gmane.org">http://lists.debian.org/i3e8ok$utb$1@dough.gmane.org


All times are GMT. The time now is 11:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.