将 Systemd (systemctl) 文件从 CentOs 转换为 Ubuntu

将 Systemd (systemctl) 文件从 CentOs 转换为 Ubuntu

我在 Ubuntu 16.04 上安装了airflow。我有如下文件:

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[Unit]
Description=Airflow celery flower
After=network.target postgresql.service mysql.service redis.service rabbitmq-server.service
Wants=postgresql.service mysql.service redis.service rabbitmq-server.service

[Service]
EnvironmentFile=/etc/sysconfig/airflow
User=airflow
Group=airflow
Type=simple
ExecStart=/bin/airflow flower
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

我已阅读文件下面的以下评论。

请记住,这些文件是针对 CentOS 配置的。如果您在 Debian 中安装它们,请替换 EnviromentFile 变量并修改 ExecStart 中 Bash 的路径。

我对Linux系统没有任何经验。

我已经使用了上面的文件,但它不起作用。谁能告诉我我应该做什么?

气流位于“~/airflow”

答案1

我注意到的第一件事是文件的路径不正确。

你的配置文件有ExecStart=/bin/airflow flower,但在你的评论中你说

气流位于~/airflow

~//home/$user当前登录用户的目录。

相关内容