-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Monitor proftpd to ensure it comes up correctly on system starts.
Signed-off-by: Volker Theile <votdev@gmx.de>
- Loading branch information
Showing
6 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
deb/openmediavault/srv/salt/omv/deploy/monit/services/files/proftpd.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# - Use the sysV init script here instead of the systemd unit file. | ||
# - Use 'restart' to start the daemon, thus the sysV init script takes | ||
# care about the PID file which seems not to be cleaned up correctly. | ||
check process proftpd with pidfile /var/run/proftpd.pid | ||
start program = "/etc/init.d/proftpd restart" | ||
stop program = "/etc/init.d/proftpd stop" | ||
mode active | ||
if failed port {{ proftpd_config.port }} protocol ftp for 3 cycles then restart | ||
{%- if email_config.enable | to_bool and not notification_config.enable | to_bool %} | ||
noalert {{ email_config.primaryemail }} | ||
{%- endif %} |
49 changes: 49 additions & 0 deletions
49
deb/openmediavault/srv/salt/omv/deploy/monit/services/proftpd.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This file is part of OpenMediaVault. | ||
# | ||
# @license http://www.gnu.org/licenses/gpl.html GPL Version 3 | ||
# @author Volker Theile <volker.theile@openmediavault.org> | ||
# @copyright Copyright (c) 2009-2019 Volker Theile | ||
# | ||
# OpenMediaVault is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# any later version. | ||
# | ||
# OpenMediaVault is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
{% set proftpd_config = salt['omv_conf.get']('conf.service.ftp') %} | ||
|
||
{% if proftpd_config.enable | to_bool %} | ||
|
||
{% set email_config = salt['omv_conf.get']('conf.system.notification.email') %} | ||
{% set notification_config = salt['omv_conf.get_by_filter']( | ||
'conf.system.notification.notification', | ||
{'operator': 'stringEquals', 'arg0': 'id', 'arg1': 'monitprocevents'})[0] %} | ||
|
||
configure_monit_proftpd_service: | ||
file.managed: | ||
- name: "/etc/monit/conf.d/openmediavault-proftpd.conf" | ||
- source: | ||
- salt://{{ slspath }}/files/proftpd.j2 | ||
- template: jinja | ||
- context: | ||
proftpd_config: {{ proftpd_config | json }} | ||
email_config: {{ email_config | json }} | ||
notification_config: {{ notification_config | json }} | ||
- user: root | ||
- group: root | ||
- mode: 644 | ||
|
||
{% else %} | ||
|
||
remove_monit_proftpd_service: | ||
file.absent: | ||
- name: "/etc/monit/conf.d/openmediavault-proftpd.conf" | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters