Convenção de nomenclatura para / var / lock / subsys no sysvinit com vários pids

1

Neste artigo Dicas e truques da Red Hat , é dito:

When a service is started through an init script, a file is touched in the /var/lock/subsys/ directory with the same name as the init script. When the service is stopped, this file is removed. The contents of this file are unimportant for the scope of this article, as long as the filename is the same as the init script.

No entanto, alguns serviços podem exigir vários bloqueios. Por exemplo, um dos scripts de init do GitLab requer um bloqueio para unicórnio e um bloqueio para o sidekiq:

# The PID and LOCK files used by unicorn and sidekiq
UPID=$APP_PATH/tmp/pids/unicorn.pid
ULOCK=/var/lock/subsys/unicorn
SPID=$APP_PATH/tmp/pids/sidekiq.pid
SLOCK=/var/lock/subsys/sidekiq

Teria sido melhor se os desenvolvedores tivessem usado /var/lock/subsys/gitlab-unicorn e /var/lock/subsys/gitlab-sidekiq ? Ou talvez um diretório /var/lock/subsys/gitlab/ ?

Este problema pode ser evitado de alguma forma usando um único arquivo de bloqueio?

Qual é a melhor prática para esta situação?

    
por Ed I 11.09.2014 / 19:15

0 respostas