Hi Kristis,

I managed to find a bit more details about the problem. It's partially
described here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=353015

In summary:
* Process names in Linux usually get truncated (probably up to 15 characters
but I suppose that may change). In my case - /proc/<pid>/stat contains
(scmbug_daemon.p) as process name. That's why start-stop-daemon can't find
the process on stop
* As the described in the above-mentioned bug: it's better to use --exec
instead which is supposed to be more reliable.
* There is an example init script in /etc/init.d/skeleton (at least in
Debian in Ubuntu) which may be used as start point for init scripts (that
should also help for the other issue with the LSB compliance)
* Looking at other init scripts - I can see usually when --pidfile is
specified on stop - then --exec is not specified (though sometimes both are
present).

So I think it would be safe to get rid of that --name parameter from both
start and stop. We already have --exec on start which would be enough. On
stop: --pidfile should be enough, though --exec may also be added.

As further improvement actions: a new script could be implemented based on
/etc/init.d/skeleton sample.

Regards,
Yavor

On Mon, Jul 12, 2010 at 09:45, Yavor Nikolov <[email protected]>wrote:

> Hi Kristis,
>
> I suspected that having "--name scmbug_daemon" on stop may trigger
> searching daemon process by name instead of by pidfile. Actually I'd like to
> test that again - I would expect having both --pidfile and --name to try
> both of them (though I'm not sure what's the intended behavior).
>
> The reason just "--name scmbug_daemon" (without --pidfile) didn't work is
> that process name was something like "scmbug_daemon.pl" or
> "scmbug_daemon.p" while start-stop-daemon is searching for "scmbug_daemon".
>
>
> Regarding the other issue (status command) - there are some other commands
> too. I'll post details in a separate message for that since it's independent
> of the start-stop-daemon script.
>
> Regards,
> Yavor
>
>
> On Mon, Jul 12, 2010 at 09:10, Kristis Makris <[email protected]> wrote:
>
>> On Sun, 2010-07-11 at 21:26 +0300, Yavor Nikolov wrote:
>> > As I've mentioned - I couldn't stop the daemon. I.e. - I tried to stop
>> > the daemon using "/etc/init.d/scmbug-server stop" but after that
>> > daemon process was still running (I checked using ps).
>>
>> I understand that the daemon failed to stop in your system.
>>
>> > After removing "--name scmbug_daemon" from script I was able to stop
>> > the same process using the above-mentioned "stop" command.
>>
>> But removing "--name scmbug_daemon" does not mean that adding it back in
>> and trying to stop the daemon won't stop the daemon. The
>> start-stop-daemon manpage shows an example of using --name <somename> to
>> stop daemons. Thus the command issued appears correct. The reason it
>> fails needs to be further investigated. I am not convinced removing
>> "--name" fixes something; I believe it may be breaking something.
>>
>> Perhaps you upgraded from an older scmbug version while a scmbug daemon
>> was already running and a pidfile with an incorrect pid stayed around.
>>
>> > There was no problem with daemon starting in fact (maybe no need to
>> > change the start command).
>>
>> That's what threw me off in the patch.
>>
>> > /Actually - I thought looking a bit more details about start/stop
>> > scripts since I also got a warning during .deb installation (probably
>> > due to lack of "status" handling which seems to be mandatory according
>> > to Debian's docs)./
>>
>> Thanks. This should be addressed.
>>
>> http://bugzilla.mkgnu.net/show_bug.cgi?id=1481
>>
>>
>
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

Reply via email to