[systemd-devel] [PATCH] service: remove pidfile after exit of a service

Lennart Poettering lennart at poettering.net
Tue Sep 10 07:58:44 PDT 2013


On Wed, 28.08.13 19:27, Lukas Nykryn (lnykryn at redhat.com) wrote:

Applied! Thanks!

(Added a longer comment though)

> ---
>  TODO               | 2 --
>  src/core/service.c | 4 ++++
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/TODO b/TODO
> index fe305ec..3527970 100644
> --- a/TODO
> +++ b/TODO
> @@ -60,8 +60,6 @@ Features:
>  
>  * better error message if you run systemctl without systemd running
>  
> -* unlink PID files of units after exit
> -
>  * tiny tool that saves/restores backlight
>  
>  * systemctl status output should should include list of triggering units and their status
> diff --git a/src/core/service.c b/src/core/service.c
> index 4070fd7..916821f 100644
> --- a/src/core/service.c
> +++ b/src/core/service.c
> @@ -1957,6 +1957,10 @@ static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart)
>          /* we want fresh tmpdirs in case service is started again immediately */
>          exec_context_tmp_dirs_done(&s->exec_context);
>  
> +        /* try to delete pidfile*/
> +        if (s->pid_file)
> +                unlink_noerrno(s->pid_file);
> +
>          return;
>  
>  fail:


Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list