Skip to content

removes PID file? #5

Open
Open

Description

@stuart-little

I was wondering if it is intended behavior that the PID file be removed upon issuing a stop command. I have this, in a script titled <path>/pl.pl:

#!/usr/bin/env perl
use warnings;
use v5.12;

use App::Daemon qw( daemonize );

daemonize();

while(1) {
    sleep(1);
}

If I start it and run <path>/pl.pl status I get

Pid file:    ./pl.pid
Pid in file: 1080593
Running:     yes

Then:

$ <path>/pl.pl stop
$ <path>/pl.pl status
---
Pid file:    ./pl.pid
No pidfile found

I ask because the docs seem to suggest the output to status should be something like

Pid file:    ./pl.pid
Pid in file: 1080593
Running:     no
Name match:  0

Activity

  1. stuart-little commented on May 10, 2021

    @stuart-little
    Author

    Actually, I can see the various calls to unlink the PID file upon stopping the daemon, but then when would the process be found to not be running?

    Perhaps that's in the eventuality that something's gone wrong and it stopped prematurely, without the stop command?

    In any event, I was just wondering what the intent was there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions