From: Malte Forkel on
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(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i33ur9$552$1(a)dough.gmane.org
From: Jordon Bedwell on
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(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4C55841C.6090704(a)envygeeks.com
From: Malte Forkel on
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(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i3602p$les$1(a)dough.gmane.org
From: Jordon Bedwell on
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(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4C56A94A.9060702(a)envygeeks.com
From: Bob Proulx on
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