Qual é a função do execstartpre diretiva do sytemd?

0

Estoutrabalhandoem link e chegaram à seção sobre como criar um arquivo de unidade do systemd.

O arquivo está listado como na captura de tela, mas estou confuso com a seguinte linha:

ExecStartPre=/bin/bash -c 'mkdir -p /run/uwsgi; chown sammy:www-data /run/uwsgi'

We'll use the ExecStartPre directive to set up the pieces we need to run our server. This will make sure the /run/uwsgi directory is created and that our normal user owns it with the www-data group as the group owner. Both mkdir with the -p flag and the chown command return successfully even if their operation is not needed. This is what we want.

Em linguagem simples, o que isso significa e por que está sendo feito?

    
por user61629 02.02.2017 / 15:59

1 resposta

1

Quando o serviço é iniciado, o ExecStartPre é executado antes do serviço. No comando acima, está criando uma pasta /run/uwsgi e, em seguida, define o proprietário dessa pasta para o usuário sammy .

Pelo manual ...

Putting sockets in /run/ On a modern system, /run/ is mounted as a tmpfs and is the right place to put sockets and pidfiles into.

Eu me arriscaria a adivinhar como o tutorial explica como fazê-lo é obsoleto.

Você pode encontrar mais informações sobre como executar o uWSGI com o Systemd aqui ...

link

    
por bc2946088 02.02.2017 / 16:04